Page 1 of 1

Assigning new host if host DCs

Posted: 23 Apr 2008, 08:53
by KDR_11k
Since all computers know the full gamestate anyway isn't it possible to elect a new player host if the host disconnects and the game is still running?

Re: Assigning new host if host DCs

Posted: 23 Apr 2008, 09:59
by Auswaschbar
There are some issues with this:
1. Only the host knows the IP's of the players
2. Only the host has a connection to every player. The others would need to connect to the new host, which can be problematic because of NAT, ports not forwarded, firewalls etc.

Re: Assigning new host if host DCs

Posted: 23 Apr 2008, 17:27
by malric
I would say that still, may times players would be able to continue with another host. I'm saying this because I can host but usually I just play in other people games. This can be true for more people.

Re: Assigning new host if host DCs

Posted: 23 Apr 2008, 18:14
by Pxtl
Auswaschbar wrote:There are some issues with this:
1. Only the host knows the IP's of the players
2. Only the host has a connection to every player. The others would need to connect to the new host, which can be problematic because of NAT, ports not forwarded, firewalls etc.
Hosting settings (port, hole-punching, etc) could be moved out of the server panel and added to a player's personal settings in the UI. Then, when they join the game, the primary host receives the information from all players and distributes the list to every player. Each player attempts to connect to every other, and returns their success. The primary host then takes the subset that every player can connect to, builds an ordered list, and synchronizes that list to all players. That list is used as the fall-back order of hosts. When first host fails, fall back to second. When second host fails, fall back to third, and so-on.

Re: Assigning new host if host DCs

Posted: 23 Apr 2008, 18:48
by imbaczek
the host could choose a backup host and tell others about it, the NAT hole could be then kept open by sending keepalive packets from all clients. when the original host dies, backup assumes hosting role and chooses another host. sounds simple. as usual, the real problem is making this work, figuring out all details and refactoring spring's internals to support such magic.

Re: Assigning new host if host DCs

Posted: 24 Apr 2008, 01:50
by Tobi
Yeah, the host to which most people can connect can be determined in the background when the game starts. Then that host would become backup host. (in case of everyone being able to connect to multiple players, some average ping could be used to break the tie)

But imbaczek's right either way, it will require quite some modifications/refactors to spring's internals.

Re: Assigning new host if host DCs

Posted: 24 Apr 2008, 02:09
by LordMatt
The OP is capable, is he not? :P

Re: Assigning new host if host DCs

Posted: 24 Apr 2008, 02:12
by aegis
In Warcraft III, it's fun to watch the original host ragequit and the game continue smoothly.

Re: Assigning new host if host DCs

Posted: 28 Apr 2008, 20:57
by bibim
By the way, did you know that you can still host even if you crashed ? Just don't close the error message box (don't click on "OK" or anything). Then spring executable still runs in background and acts as a dedicated server (it only uses 5-10% of proc and only forwards packets). At least it works on my computer ;)