How do peer-to-peer games work?

Started by
6 comments, last by Madhed 12 years, 1 month ago
I was a bit surprised to hear that most games on the Xbox use peer-to-peer technology for multiplayer. I didn't even think that would work, since some computer most contain the state of the game world, or at least so I thought. Among the games that use Peer to peer are Halo 3 and Modern Warfare 2. Both action games with a lot of things going on in them. Now how do these work? If one player fires a weapon, I suppose that info is transmitted to the other computers. But who decides who's shot or not? The receiving computer? Wouldn't it be easy to just hack the game and ignore such checks? Or what if it's the other way around, some computer tells another one that it has been hit. Can't it just tell all its opponents that they've been hit? (Again, wouldn't the receiving computers be able to ignore it?) Can someone explain exactly how these things work?
Advertisement
They're not peer-to-peer in the technical sense. They actually use a client-server network architecture. However, there is no authoritative server. Rather, one of the players' XBox is picked to be the server. A lot of gamers refer to this as "peer to peer," because there is not a dedicated server, but the logical network topology is still client-server.
These games are not peer-to-peer, they simply don't use a dedicated, fulltime server.

This is because Xbox live, in terms of matchmaking, is just that -- a matchmaking service. They provide functionality to find other players, but once the game begins one of the players (hopefully the one with the best connection to the rest of the players) is chosen to be the server.

I'm sure you've heard of players in these games saying that they "got host" -- this means they were chosen as the server, and its a big advantage because there is no discrepancy between what they see, and what the "real" state of the game is.

The big difference between client-server and peer-to-peer is that in the former, one machine has the absolute, authoritive say about the way things are. In general, this is good for security because only a corrupted server can affect the gameplay negatively. In peer-to-peer, this state is not located in any one machine -- it is typically either shared amongst peers who control "domains" of the game, or it is replicated across machines (sometimes in a voting arangement). In general, security is more difficult in peer-to-peer setups because any single corrupt client negatively effects the gameplay experience, and no other single peer has the authority to correct the "real" state of the game, nor to boot the problem player.

throw table_exception("(? ???)? ? ???");

Ah, I see. Thanks for the clarifications.

Quote:Original post by RavyneI'm sure you've heard of players in these games saying that they "got host" -- this means they were chosen as the server, and its a big advantage because there is no discrepancy between what they see, and what the "real" state of the game is.


I wonder how competitive gaming is handled if this is the case. I don't know about xbox live because I don't play there, but in the pc game communities I know of, the attitude towards latency is that everyone should have the same or as close to the same as possible. Playing at the same conditions is essential. I really don't see how that could work if one player has the huge advantage of owning the state.
Well, you're right that this means that the playing field isn't absolutely level, but this is nothing new.

PC games aren't always running on dedicated servers either, you know. Many PC games give you the option to host a game on your own PC, even while you're playing. Its another bit of luck when you aren't hosting, but perhaps you've got a really good connection between yourself and the host -- say the host is in your general area and using the same ISP -- granted your experience isn't going to be as flawless as his, but its certainly going to be better than a player who's located half-way across the country or worse.

The network means that every player has a different experience, and it wouldn't be a good idea to lock everyone into the lowest common denominator, or even the average denominator, artificially unless you want to lose customers in a hurry.

This is why real competitions are always held in a LAN environment -- even there things are not 100% perfectly balanced, but the idea is that on a fast, closed network that things never diverge/delay enough to make a difference.

throw table_exception("(? ???)? ? ???");

I came across this topic so I feel there is no need to start a new one.

Just some questions. Does this mean the system which x-box uses still contain problems which face dedicated servers as well? By this I mean that if the elected server was somehow to drop out the whole game session would end.

Are there limits to how many clients can join the game? If I recall Modern Warfare has a max of 18 players but what if the broadband speed of the elected server can only handle up to 10 clients before issues such as lag start. Will the server allow there to be more than 10 clients or will it know when to cut off the amount of players? (Most of my gaming is LAN based so I'm not sure if this holds true xbox live games)

Is there any documentation which I can read up one how the matchmaking system selects a server and what protocols are used for x-box online games?
[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

if the elected server was somehow to drop out the whole game session would end.[/quote]

[/font]




[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

If the game does not implement host migration, then that would happen. However, most games do allow host migration. I've seen this many times: Every once in a while, when playing Modern Warfare, the game might stop, and a host migration will happen, and then the game will start up again.

[/font]

enum Bool { True, False, FileNotFound };


if the elected server was somehow to drop out the whole game session would end.



[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

If the game does not implement host migration, then that would happen. However, most games do allow host migration. I've seen this many times: Every once in a while, when playing Modern Warfare, the game might stop, and a host migration will happen, and then the game will start up again.[/font]



[/quote]

Usually when some frutrated kid gets angry and pulls the cable... ;)

I found a nice presentation about halo 3 matchmaking. It talks more about the skill balancing of player however. http://www.bungie.net/images/Inside/publications/presentations/gdc2008_butcher_chris_matchmaking.ppt

This topic is closed to new replies.

Advertisement