How do I make a multiplayer game with fixed rooms?

Get help using Construct 2

Post » Mon Apr 28, 2014 3:52 pm

Hello,

I'm trying to make a multiplayer real-time game, but, reading the tutorials, i saw that Multiplayer Plugin works creating a room when the first player joins, and the other will connect directly to this host.
This means, when that host leave the room, all the others will lose the connection.

I need a way to create a fixed host with many rooms, so everybody can join without worring about the host going away.

Any sugestion? Is it possible with Multiplayer Plugin? Or only with sockets.io/websocket plugin.

Thanks
B
3
Posts: 2
Reputation: 179

Post » Mon Apr 28, 2014 4:03 pm

Hello, you could try to make it like this:
Save the hosts name in a variable (ex. "SavedHostName")
On kicked -> Join room "SavedHostName"

And then while that happen, display a "Finding new host" message so the user now a new host is being "found".
That would be a way to handle it, so all players come together after the host left.
But on your question with creating a fixed host,
you may need to make it like having an instance (or many) of the game running on a server, while actually not doing anything else but handling messages/syncing positions.
- Conti
"It's done when it's done"

Shadows of War
Buy on Steam ;)
B
24
S
10
G
7
Posts: 253
Reputation: 4,931

Post » Mon Apr 28, 2014 10:25 pm

Thanks for the reply SgtConti.

About have an instance (or many) of the game running on a server, how exactly this could be done?
A nodejs server running a manually created file that handles the messages/syncing positions?
Does the Multiplayer Plugin have an easily way to do that?

Thanks again.
B
3
Posts: 2
Reputation: 179

Post » Tue Apr 29, 2014 12:47 pm

With the multiplayer plugin you could open multiple instances/games and assigne them to a different room.
And then modify the client to display that there are 10 rooms avaialble (In case you have 10 instances of the game running on a server),
and if the player chooses room 1 you join the first room, room 2 chooses room 2, etc.
But for that you need on the host (server) side, to have assigned each instance to a seperate room and to decrease the load of the gpu, make everything invisible (The whole layout), even tho it's invisible, the positions are still being calculated and synced with each peer.
On the client site you can request the amount of peers in each room to display it besides the name of the room, if you have a player cap per room.
- Conti
"It's done when it's done"

Shadows of War
Buy on Steam ;)
B
24
S
10
G
7
Posts: 253
Reputation: 4,931


Return to How do I....?

Who is online

Users browsing this forum: rayolf and 18 guests