multiplayer: manual close and open the room

Discussion and feedback on Construct 2

Post » Mon Nov 17, 2014 11:41 am

hi,
in some of games we must close the room before start the game and open room again after game finished...
please add this into multiplayer plugin
thanks...
B
16
S
6
Posts: 243
Reputation: 1,755

Post » Mon Nov 17, 2014 4:26 pm

Could you give a case sample of your want.

Why do you need to close the room?
Why do you need to open a new room?
Why do you need to do either after a round?

You Rooms are not associate to layout. Just set a share variable between everybody that represents room state and use messages when a room state change occurs.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018

Post » Tue Nov 18, 2014 7:43 am

jayderyu wrote:Could you give a case sample of your want.

Why do you need to close the room?
Why do you need to open a new room?
Why do you need to do either after a round?

You Rooms are not associate to layout. Just set a share variable between everybody that represents room state and use messages when a room state change occurs.

in some games you need that .. like :
command and conquer series.. and so many games.. (an engine must support all type of games) if player start room with 6 player max .. but if 4 player in the room and they start the game so .. no one must join the room after the game starting .. they can not join in the middle of game...
B
16
S
6
Posts: 243
Reputation: 1,755

Post » Tue Nov 18, 2014 10:30 am

Why not just have a lobby and handle peer connections as part of the implementation of the multiplayer logic ? The host can kick/reject any unwanted player, and you would need something like this anyway to deal with players being disconnected and/or trying to reconnect.

Unless I am missing something, I don't think this requires any new networking features ; this requires little work but helps with genericity and flexibility, anything too specific is likely to be a limiting factor for other types of games.
Image
Game Producer & Independent Developer - http://raphaelgervaise.com
B
23
S
9
Posts: 237
Reputation: 2,207

Post » Wed Nov 19, 2014 3:08 am

I dont' see a requirement of your needs to change anything. What you need can already be done.

For the host when the game starts go into PlayMode. When another joins kick them.

As for ready state and play state. Just note those on the host.

Tons of games have the features you want in standard host/play, but the mp system already supports it. You just needs to figure out how.

Good luck on your project. However as a word of advice. Do simpler MP first. The MP world is an entirely different beast to tame. I've already seen developers think just because it's in c2 that MP suddenly becomes easy. While C2 does lower the programming barrier. There is not a low that makes MP all that simpler.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018

Post » Wed Nov 19, 2014 12:27 pm

@jayderyu , @Refeuh

for example :
peers see the rooms and they choose a room and they connect to that room but after they clicking on the room they got kicked because players in the game...and they can't join in the room but room is not full and they can see that ... so this is not good .. because they must join in available rooms .. and if we have a very big room and all peers join into that... we can not do that .. that is obvious..(if lobby host got disconnect - peers disconnect and reconnect problem - they must return to that room after game end they must disconnect again! and who made the room must be host .. but we can not tell who is the host in game because we tell every body disconnect and reconnect again so maybe who is made the room not be host ! and after game that player is not host !!
and construct 2 is here for making things easier... not harder !)
B
16
S
6
Posts: 243
Reputation: 1,755

Post » Wed Nov 19, 2014 3:54 pm

Well... in the end a tool is just a tool, and there's always a balance to find between genericity+flexibility and productivity+ease-of-use.

The C2 solution to simple multiplayer is quite elegant ; it's functional and it works easily. Obviously the design choices in terms of technologies and architecture mean it won't be suitable for every project (esp. on the security side due to the host/peer approach), but it's good enough for the kind of games you would expect to do with such a high-level tool.

Part of good development practices is to choose the right tool for the right tasks. If C2 is not suitable for your project, or if you end up fighting the existing functionalities rather than using them, maybe a different tool would be more appropriate.

There's always the possibility of trying to run your own match-making, signalling, routing, etc. but if the goal is to make a game and not create new technologies, and would suggest working your design around the existing limitations to keep focusing on high-productivity.
Image
Game Producer & Independent Developer - http://raphaelgervaise.com
B
23
S
9
Posts: 237
Reputation: 2,207

Post » Wed Nov 19, 2014 4:23 pm

@mahdi71
Well since I can do everything your asking for. I don't see the problem. I offer you good fortune to your design. I did MP programming, i wrote my own server and client. I find C2 MP easier due to it's event sheet. C2 MP is easier. Good luck. And you never know. @Ashley might include your feature request.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018

Post » Wed Nov 19, 2014 4:31 pm

mahdi71 wrote:peers see the rooms and they choose a room and they connect to that room but after they clicking on the room they got kicked because players in the game...and they can't join in the room but room is not full and they can see that ... so this is not good .. because they must join in available rooms .. and if we have a very big room and all peers join into that... we can not do that .. that is obvious..(if lobby host got disconnect - peers disconnect and reconnect problem - they must return to that room after game end they must disconnect again! and who made the room must be host .. but we can not tell who is the host in game because we tell every body disconnect and reconnect again so maybe who is made the room not be host ! and after game that player is not host !!

You just need to be creative to be able to figure that out. You need a room manager, which you can do yourself, I did it, I call it lobbyhost. Instead of open/close room, let the lobbyhost assign running number to rooms, this way is much easier to maintain a unique room number. In my case I use unix time stamp as the running number.

Leaving and joining room is as normal as it is, if you look at any other MMORPG, such as WOW, TERA they did this as well, notice the loading screen? It's actually a fake screen to download current data of the room, not loading the game locally. Game load locally much faster than they download all current data, that's the truth.

In case of you're design your game in a way that you let players to create room themselves, and set who can join with or without password, set the room peer limit, create unique room name, auto join room, this is extremely doable, in fact the the MP plugin was designed totally for this scenario, which we call peer-to-peer MP.

mahdi71 wrote:construct 2 is here for making things easier... not harder !)

It is already much easier for most people than you can imagine. Try the traditional way then, see how it goes. The complexity of MP goes exponentially to the complexity of your game, you need to realize that first!

Don't blame the bow if you can't get a bulls eye.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Wed Nov 19, 2014 6:36 pm

jayderyu wrote:I dont' see a requirement of your needs to change anything. What you need can already be done.

For the host when the game starts go into PlayMode. When another joins kick them.

As for ready state and play state. Just note those on the host.

Tons of games have the features you want in standard host/play, but the mp system already supports it. You just needs to figure out how.

Good luck on your project. However as a word of advice. Do simpler MP first. The MP world is an entirely different beast to tame. I've already seen developers think just because it's in c2 that MP suddenly becomes easy. While C2 does lower the programming barrier. There is not a low that makes MP all that simpler.

if when i loading the rooms list.. i connect to each host (with a small delay for connecting to each host like 0.5 sec) and ask for state and ping maybe.. then multiplayer server dont kick me out and block me? for connecting so much into server ? because for connecting to a room the multiplayer server must respond .. ? (if my room number be like 100 or more...) and i must keep rooms state updated in every 10 sec...
B
16
S
6
Posts: 243
Reputation: 1,755

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 11 guests