Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to wrap my head around how any one of the clients could become a new host should the current host leave the game. I'm not looking for any code, but more of a high level application design of how a feature like this would work.

share|improve this question
up vote 2 down vote accepted

Leader election is an interesting topic, and there are several solutions available.

One such solution is the "bully algorithm", in which all clients (including the host) have unique IDs, which determine rank/priority to control an election. When a client detects that the host is no longer present, it sends out an inquiry to higher ranked nodes to see if they are active. If it receives no response, it declares itself the leader (host) and notifies all other clients of the change.

You can read more about this method, and a few others, in the Wikipedia article I've linked.

share|improve this answer
Thanks for the starting point. – Matt Feb 28 '12 at 15:16

Your Answer


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.