Multiple Lobby Types in VS Mode

Posted by fliptech

Thanks for the great extension. Every features i tried so far works well.
I am not sure how to create different types of lobbies for my game in VS mode. For my game i want four different type of VS mode lobbies.
When a user selects a lobby he needs to join only with a user in same lobby. Please help to implement this.

Replies (5)

Last message on 25 Jul 2016

Size43 (Administrator) on 9 Jul 2016, 21:02:05
Currently the VS Mode only supports one lobby. This will most likely be expanded in the future (v3), but for now you'll have to implement your own lobby system using the session system and P2P messages or the INI files.

Some tips:

Use the session types to identify what kind of lobby or game it is. For example 10, 11, 12, 13 for the 4 lobbies, and 20, 21, 22, 23 for the games of that type.

Each session has its own master player. Have the master player control when the game starts by sending a P2P message.

You could use the INI files to store more information about the sessions.

Sessions will be deleted once everyone leaves them, so you might need to create a new session when a player tries to join a lobby.

Let me know if you need any more help on this. While I can't build the system for you (I'm currently working to earn money, and after that I'll be working on v3), I'm always prepared to answer questions.
fliptech (Topicstarter) on 11 Jul 2016, 08:26:34
Thanks for the tips. The problem i face when using session for VS mode is that i cannot limit max number of players in game to two. So to find a game with free slot, i need to check number of players in all the sessions of that particular lobby. This might end up in using too many calls to the server.
Size43 (Administrator) on 25 Jul 2016, 17:13:44
Apologies for the delay. I've been working a lot in the past few weeks, at some points up to 10 hours a day. That left very little time for me to do anything besides work.

You should be able to set the maximum number of players here on the site. (under game-settings).

Only gms_session_create and gms_session_join need to contact the server. All session information is pushed from the server to the client, so for example iterating all sessions every step does not impact the server at all.
fliptech (Topicstarter) on 25 Jul 2016, 19:14:04
Good to know that all session information is pushed to client. Its a big relief. But in game-settings the maximum number of players is available only when VS mode is enabled.
Size43 (Administrator) on 25 Jul 2016, 21:05:09
That's correct. If you don't use the VS mode you will need to handle that manually.