Multiplayer secondary host

Discussion and feedback on Construct 2

Post » Wed Jan 13, 2016 8:32 pm

I was reading the Multiplayer tutorials and when I read that when the user acting as host server leaves the room, all the other peers are kicked out of the room, I was a bit upset. :?

Wouldn't it be better to have a secondary "inactive" host who takes over the role when the primary host leaves?

I think it's quite annoying if, let's say, 5 people are playing, and the first who entered the room leaves, the game is over, but if any other leaves, the game isn't over.

Maybe the signaling server should add another role (scndHost) and dynamically manage who is the Host, the scndHost, and the peers, depending on who leaves the room at any time. :idea:

The game I'm working on cannot afford to kick out everybody just because the first who entered the room leaves. :cry:
B
11
S
3
G
1
Posts: 19
Reputation: 905

Post » Thu Jan 14, 2016 3:43 am

+1, struggling with this too...
B
70
S
14
G
1
Posts: 151
Reputation: 4,949

Post » Thu Jan 14, 2016 10:24 am

I would like @Ashley to say something about this ;)
B
11
S
3
G
1
Posts: 19
Reputation: 905

Post » Thu Jan 14, 2016 12:23 pm

The main reason it's not supported is because it's incredibly complicated. If the connection to the host drops without warning, then the clients may be missing important state information that only the host had, so cannot take over as host. To mitigate that you'd need to continually sync data from the host to other peers so that they can take over if need be, but since this is all game-specific data the multiplayer engine can't handle that for you - you'd have to do an awful lot of events for ongoing synchronisation and then a tricky transition from peer-state to host-state while hoping all the peer reconnections work (and at that point some of them could fail, e.g. if the peer who is becoming host is behind a NAT that only allows them to act as peer and not host, so then nobody can connect and the game fails anyway).

One way of solving this would be to run the host on a dedicated server instead.
Scirra Founder
B
383
S
225
G
86
Posts: 24,119
Reputation: 190,546


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests