Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

When designing a networked multiplayer-game where one player hosts and others connect, there are two strategies I'm aware of:

  • Have the host-player's game be the authority, with all other players as dumb-clients trying to catch up with the current game-state. In the code, there will have to be lots of special cases, depending on if the current player is the host or not.
  • Make the host a dumb-client like everyone else by running a hidden dedicated server on another thread. The dedicated-server will be the authority, and the host will connect to it like everyone else (through localhost).

What are the advantages/disadvantages of each of these? Which is used most often (or does it vary by game type/size)?

share|improve this question
    
The first case you are describing can be one form of P2P networking(with one authoritative client) and its usually much more complex, and harder to implement and maintain. –  akaltar Dec 24 '13 at 1:29
add comment

2 Answers

The dumb-client approach is best from a pure design point of view- it heavily limits the amount of different code you need between host and clients, and allows the server to run asynchronously. The downside is that the host's machine requires extra resources- but I guess it always did.

share|improve this answer
add comment

Between these two options the dumb-client approach is certainly best for the reasons DeadMG mentions.

There is another option which is make every client an authority, it has the advantage of the dumb-client that all peers share the same code. The other advantage is that it might be a lot more fair if you set the right rules because no one has the 0-lag-to-server advantage.

This can ofcourse be rather tricky to implement depending on the game type. Your protocol will have to deal with solving conflicts between peers, probably using some kind of ownership scheme. Leaving only the conflicts where 2 peers claim ownership of the same game object.

Googling Peer-2-Peer multiplayer protocols might give you some more details about this approach.

share|improve this answer
1  
gamedev.stackexchange.com/questions/3887/… Here's some more info :) –  michael.bartnett May 28 '11 at 0:30
    
Interesting. That post claims that this is how "most strategy titles" implement networking. Is this really true? Is this how eg. Command and Conquer and Starcraft work? –  BlueRaja - Danny Pflughoeft May 28 '11 at 2:10
    
@BlueRaja, this is how Starcraft works, yes. In Starcraft there is no authority at all. Warcraft III and Starcraft II have more centralised message exchange model, lag and disconnect handling, but fundamentally the same in that each client hosts its own game state. –  Rotsor May 28 '11 at 7:24
    
The other advantage of this networking model is that it allows to support large consistent shared world state with minimal synchronisation traffic. –  Rotsor May 28 '11 at 7:27
    
The largest disadvantage of this model is its inherent vulnerability to "maphacking", that is revealing some game state data the player can't normally see. –  Rotsor May 28 '11 at 7:31
show 5 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.