views:

223

answers:

5

I've been mulling over how one would go about creating a P2P system (like BitTorrent is for files) for playing multiplayer games. The idea is to remove the traditional server from the multiplayer architecture. I understand that some sort of server may be necessary for initiating the communications and sending world updates etc, but I'm interested into how you would reduce the load and bandwidth pressures on the server.

By the way, this goes for any size game, from a two player checkers game right up to a FPS with 30+ players.

Am I crazy?

A: 

I'm certainly no expert, but it sounds a little crazy to me. In my experience, you need dedicated game servers because of bandwidth and performance. With P2P you would lose both of those things. In my opinion, P2P is good for a few things. Distributing files and research are among them. However, those 2 things don't need real time data. If you had some sort of massively multiplayer game world, then you could probably use P2P to distribute game files, and maybe even offload number crunching.

I would say there are possibilities, but the number of them seem limited, although potentially powerful.

SkippyFire
@SkippyFire: many RTS games, like Starcraft and Age Of Empires, are P2P, exactly because that way they have **better** performance than going through a server! Where in performance I mean latency (the bandwidth is very minimal in these games)
yairchu
+1  A: 

I've been thinking about the same thing. I've got a long-time prejudice that distributed systems ought to be distributed, with no need for a central controller. The issue with an MMO or similar game is that every player should be able to see the same "world". You end up with an issue similar to Einstein-ian Relativity and "simultaneity" -- the farther apart you are, the more your view of the world differs.

In general, the solution is that you have to be able to propagate information to other clients in your immediate neighborhood -- in the in-gamer space, not necessarily physical space -- fast enough that updates appear simultaneous to all the local players.

I suspect the answer is to have a "server" or world-model per player, rather than representing the players as vectors in a world server.

Charlie Martin
+9  A: 

The big problem is not bandiwdth or latency or distributing changes to the game state. The big problem is trust.

If I tell you I killed a monster, how do you verify that I actually did it? How do you verify that I'm actually level 45? How do you verify I'm not teleporting around the world? Remember you can't check the server for every little detail: that's what we're trying to avoid!

You need players watching players and even then they might work together to cheat. I really doubt anyone will engineer a trustworthy p2p MMO anytime soon.

Strilanc
+1 to quote Ralph Koster, the client is in the hands of the enemy.
David Locke
_Raph_ Koster :-)
dave
+1  A: 

There are many things to consider in your question:

1) Distributed master - who starts the game then? where can I find the first node? what if everyone decides to close their P2P client at the same time? does the world end?

2) Distrubuted rules - who can confirm that player 77 out of 102235 killed a monster at x,y,z ? I see BIG troubles in hacking/cheating with out a "chief in command"...

3) Latency - when has a client recieved all data? what if the internet breaks down? or in a LAN game, what if the harddrive dies - will this crazy the game for everyone else?

I do believe that the P2P thought is interesting, but as in all competitions, I believe that we will need a "judge" who can handle the rules, because when you are competing against "anonymous people" then its "okay to cheat" a lot thinks.

I think that some sort of grid computing might be the way to do it, but again, if some in the grid falls out or are too slow for rendering world and sending results back.. then we have the whole game "lagging"... = terrible game for everyone... this is already seen in many FPS games with a master-server. If the network protocol doesnt handle lag too well, its getting harder to hit a person running or they appear out of nowhere shooting you in the face.

An expensive solution might be to have "subservers" (proxy-game-servers) where you have some of the data more close to the players. This I believe would require you to have access to a lot of serverfarms around the world (as Blizzard does with WOW) or you will have to invent some sort of intelligent "P2P host" that will upgrade itself to "subserver" when then bandwidth is big enough and enough players are close in proxsamity of it (always checking the lag from its point of view... )... now lets say that was possible.. what if the line is broken between this subserver and the main gameloop globally again?

LOL... this could go on... it sounds more and more like the general trouble with the Internet :-)

Happy coding... !

BerggreenDK
A: 

I think this is probably possible in theory, but it is still a long way off.

As noted in the other posts, the latency could be kept low by only guaranteeing updates to other players who are nearby. This has been done for many years in distributed games.

Data loss could be kept at tolerable levels by letting several nodes be responsible for each piece of data.

Regarding the trust problem, it would be possible to have a protocol where a player could "challenge" another player to uncover cheating. I.e. the challenger would duplicate some part of the other players computation and ask to compare the results. There are already cryptographic protocols which do this sort of thing, but I don't know the details or whether they are feasible in practice.

The real problem as I see it is that there is little reason to develop such as system. The cost would be high and add complexity, but the game experience (the product) would not be significantly improved. A money-saving activity must save more money than it costs in order to be viable.

Jørgen Fogh