|
» Advertisement «
|
|
|
 |
All these multiplayer games seem to work through some kind of wizardry, don't they? Let's try to peek inside and see how exactly do they do all that neat stuff that lets you see the other players and interact with them, using our particular case, World of Warcraft. This article is rather technical, intended to dispel the magic of the client/server model used by MMORPG games nowadays. To begin with, for those that just regard the network as an ensemble of cables connected to different computers, I will try to split the communication between the client (your game) and the server (the Blizzard world server where everyone connects) into two parts, only for the scope of this writing. First, there is the connection: it's a virtual 'link' that is established between you and the server once you start playing. We will ignore the connection here, as once it's established we don't care about it anymore until it's broken and you get link dead. Now, over this connection, packets circulate both ways - every time you move, a packet gets sent to the server; every time someone around you moves, a packet gets sent from the server to you.Iin general, for every action you do, for every mouse click, or every key you press, a packet is sent to the server. You can regard the packets as actions of a player or changes in the state of the world (a monster moved, an NPC said something).
Of course, any MMORPG has different packet types for different possible actions: in general, when a player is casting a spell, the client sends a packet that is totally different compared to the packet sent when the player sits down. World of Warcraft must also make use of this networking model as there is simply no other usable setup. There are probably hundreds of types of packets for all the possible actions, but this is beyond our scope. Let's move on and see what happens in the (probably) most basic case of movement. Once you hit forward, the client sends a packet to the server telling him that you are trying to move. The server may or may not acknowledge it, but that is rather irrelevant and depending on the implementation - acknowledging it would prevent cheating by increasing movement speed client side or by making a walk-through-walls hack, but this also means a lot of processing on the server which has to calculate the new player position on the map, check against the player speed and the last known position, check the collision to the map objects and so on.
I'm drifting away from the subject, though; server mechanics could constitute the subject of a totally different article. So, let's assume there's a player in your immediate vicinity and you hit the forward key - for this player to see the fact that you moved, the server has to send him a packet letting him know that you moved and once this packet is received, his game client will know it has to update your position. This is a simplified example as there are probably more packets involved such as starting to move and stopping. What do we have so far? We know that in order to have your actions displayed on other people's screens, the server must send packets about your actions to them. Does this have any impact on your connection? Not at all. When there are 50 players in your vicinity, your movement gets send to each of them, but it's going on their connection, not on yours so it has no effect on you whatsoever. But what happens if the other 50 players all start moving at once? You get 50 packets that tell your game client to update the position of each of the 50 players...
Now this does have an impact on your connection as you're theoretically going to receive 50 packets at once. I'm only talking about vicinity here as I'm sure WoW as every other MMORPG must have some mechanisms to send the actions only to the people who should see them - just try to imagine sending all the data about all the players on the server to each player, a few hundred people doing something and all that data coming to you... Trust me, you don't want that and neither does Blizzard as they would probably run out of bandwidth after 300-500 users or so, because in such a case the traffic would scale up exponentially for the server (500 users doing something at once means 500 packets sent to 500 users which is 250000 packets). By now, you're probably wondering how such a packet would translate into the familiar kilobytes/second.
Let's do a small analysis of our movement packet: it will have around 50 bytes of overhead (information that helps the packet travel around the internet), probably a 4-byte or 8-byte packet header, the identifier of the player who is moving which could again be 4 bytes or 8 bytes, the (new) X, Y and Z coordinates for the player which would sum up to 12 bytes (assuming they are some 4-byte float numbers) and the rotation of the player which would probably be another 4 bytes float number. Keep in mind that these are only the mandatory fields that should go in such a packet and they sum up to around 75 bytes. Most likely, WoW has additional data that needs to be sent and that I cannot foresee such as whether the player is walking or running etc. So, if you get a single movement packet per second like described above, you will have a traffic of 0.075 kilobytes/second (which translates to 0.6 kilobits/second).
Will the modem users be ok with that? If we assume the calculated minimum of 75 bytes per packet, a modem user could theoretically have enough bandwidth to receive the movement of almost 100 players per second. But there's another aspect: multiple movements can be grouped in a single packet, so that we don't have to bear the overhead of 50 bytes for each movement. If we group 10 movements in a single packet, we would come up with 10 packets of around 300 bytes each, summing up to a total of 3000 bytes or 24000 bits (if you didn't know already, 1 byte = 8 bits), which is less than half the bandwidth of a 56kbps modem. However, all these calculations have been based on a ‘best case'. What happens when the users start casting spells and fighting? There's a lot more data to be sent... Seeing that Blizzard is telling us that the typical raid will be 30 people, on a 56kbps modem, we would have about 200 bytes/sec for each player, up to a maximum of 230 or so.
Is this enough? Probably yes. But more than likely, a modem will not be anywhere near enough if you have to handle two faction groups of 50 people each, actively fighting in a small PvP area.
As an ending, the difference between my estimated data and the actual protocol might be quite high, so there is a possibility that the modem users will have problems in some situations. But most of the time the game should be playable without any issues. I won't get into discussing ping times which are obviously higher on a modem and which can have a big impact on the gameplay, but if you're using a modem and you intend to play World of Warcraft or any other MMORPG, from a bandwidth-only perspective my advice is: get a DSL or cable modem connection if possible.
By: birt