How do I rejoin to room in multiplayer with 2 player?

Get help using Construct 2

Post » Sun Dec 25, 2016 8:19 pm

Hi,

Think about Clash Royal game !

we have 3 minute for play and when i disconnect internet or in low bandwidgh , my enemy see the message ( the enemy left the game ). and if i connect again , i can play game with that enemy from last action! ( sorry for bad english )

is there any way, do like it?
B
10
S
3
Posts: 180
Reputation: 1,212

Post » Mon Dec 26, 2016 12:14 am

Maybe you can associate the peerId of the client with something on the host and store the peerId on a localStorage on client.
If the player is disconected you pause the game, show yyour message and wait until someone connect again.
Then when you connect to the host again (assuming you know which room to connect) you can just check the peerId on your localStorage with the peerId on the host. If they match you can just continue the game like nothing ever happened.
B
14
S
6
Posts: 11
Reputation: 1,122

Post » Mon Dec 26, 2016 6:25 am

thank you for reply.
but another problem is , first player is host, ok? so if host disconnect from internet or left room for any reason, Peer can't play on that room, because the room is not exist anymore!
B
10
S
3
Posts: 180
Reputation: 1,212

Post » Mon Dec 26, 2016 5:44 pm

up!
B
10
S
3
Posts: 180
Reputation: 1,212

Post » Mon Dec 26, 2016 7:13 pm

Yes, that's an issue. In this case I don't have a workaround in mind, but you can always have a dedicated server and keep a instance of your game running to be the host and make all the players connect trhough it. I don't know how pratical it would be in a real scenario tho, and escalability could be a problem in the future.
B
14
S
6
Posts: 11
Reputation: 1,122

Post » Mon Dec 26, 2016 11:26 pm

You could have the peer, who had the host disconnect, create a new game in the same room and instance though. Then the first host could join back and continue as cb130felix has explained.

Otherwise you would have to have the peer leave the room and wait for a game of the same type to show up, join it and then have that host reset everything back to how it was.
B
42
S
14
G
3
Posts: 165
Reputation: 5,115

Post » Thu Feb 16, 2017 11:41 am

Hi again!

is it logical to i create room with max peer : 3 ? one for host and two peer ? ( in game like clash royal )
in this case , i have host witch transmit data with to peer ?!
(sorry for bad english ):
B
10
S
3
Posts: 180
Reputation: 1,212

Post » Sat Feb 25, 2017 7:14 pm

up!
B
10
S
3
Posts: 180
Reputation: 1,212


Return to How do I....?

Who is online

Users browsing this forum: DharmaOne and 17 guests