How do I use a lobby server for a multiplayer game ?

0 favourites
  • 14 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • Hello everyone !

    I'm working on a small multiplayer game, and I want the players to choose who they play with.

    I already read Ashley 's tutorial series about multiplayer, and blackhornet 's tuto : https://www.scirra.com/tutorials/1003/tic-tac-toe-part-3-multiplayer-with-a-lobby but I don't really know how to set up the the server to do that... :-/

    These are the issues I'm struggling with :

    Number 1 : What should I use as lobby server ? Can I use a classic 1&1 webserver (like the one I use to test websites and other c2 games) or do I have to pay for an expensive game server even if the game is small and I just want the server to handle player groups ?

    Number 2 : How do I set up the server to do that ? I'm good with game logic but server management isn't my strong suit and I'm a little confused ^^'

    Number 3 : Should I use the signalling server hosted by Scirra or is it wiser to use my own not to depend on it ? How can I set up a signalling server for my games ?

    EDIT : I guess I just found an answer for n°3

    https://www.scirra.com/store/game-making-tools/multiplayer-signalling-server-161

    I would probably need some help to configure it if I buy one though ^^

    But first I still need to understand how to set up a lobby server ^^'

    Any help would be greatly appreciated, I'm new at this and it's pretty complicated for me :-/

    Thanks for your time and have a nice day

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You can get cheap servers in the cloud from places like Amazon Web Services. Their cheapest servers run around 5USD/month, and when you first sign up, you can get a free server for a year.

  • Hello gumshoe2029 and thanks for your advice, it might be helpful

    Can you answer my other questions ?

    • Can I use a classic web server or do I need something more specific ? (If so, what do I need ?)
    • How am I supposed to configure it ? It's not explained in the tutorial and I'm really confused here :-/
  • Ratmaster

    If you get the EC2 servers, they operate exactly like classic webservers (except the hardware is abstracted away). You just SSH into the Linux command console, download Linux packages (like Apache webserver), or use winSCP to upload files to the server.

    Dabble with the free server before you actually buy one.

    There is no tutorial for this, since we are the only ones (that I know of) that use AWS for our servers in the Scirra forums. I am hesitant to write a tutorial on this, because I don't want to step on Ashley 's Scirra arcade store.

  • gumshoe2029 thanks for your answer

    I think I may have misspoken (since English is not my first language) and there is a confusion here :

    • I already have a classic 1&1 web server for this whole project, and I have managed to create a classic chat room using

      Ashley 's tutorial

    I tested it (blackhornet's TTTMP-Client-130.capx with changed GAME_NAME, etc... exported and hosted on my web server) but it didn't work and I had an error message "No lobby server found" so I wanted to know how to run a lobby server at all times without having to let my computer on with a browser connected to the lobby page at all times...

    Furthermore I think the free scirra's signalling server is really unstable, because I tried to run the chat example just now and I got this error message :

    Signalling error: [object Event]

    Disconnected from signalling server

    So my questions are :

    I'm really sorry if I wasted your time because my questions weren't clear enough

  • The signalling server is designed to also function as a lobby server. Use the "request room listing" action and you get a list of available games that you can build a lobby around.

  • Ashley thanks a lot for your answer, I didn't know it could do that and I think it might really help

    Just to be sure, what do you mean by "available games" ? Does that mean that you choose the maximum number of games that can be played at the same time when configuring the signalling server ?

    Because that's what I want to do in my project :

    1. The players start by connecting to a big lobby server, where every player is connected

    2. - They can start a "public" game that everyone can join, or a "private" game that cannot be joined without an invitation, for 2, 3 or 4 players. They are then redirected to a waiting room with a chat and a button to invite other users (if they are not in a waiting room or a game).

    • They can also "join an available game" to join an unfilled public waiting room

    3. No one can join when the game is started, but guests can choose to "watch the game" if they want

    If I understood properly, to run the signalling server I will need a dedicated server and not a classic web server right ?

    Please can I have some advice to do what I described above ?

  • See the manual entry for how it works.

  • Just to be sure, what do you mean by "available games" ? Does that mean that you choose the maximum number of games that can be played at the same time when configuring the signalling server ?

    Because that's what I want to do in my project :

    1. The players start by connecting to a big lobby server, where every player is connected

    2. - They can start a "public" game that everyone can join, or a "private" game that cannot be joined without an invitation, for 2, 3 or 4 players. They are then redirected to a waiting room with a chat and a button to invite other users (if they are not in a waiting room or a game).

    - They can also "join an available game" to join an unfilled public waiting room

    3. No one can join when the game is started, but guests can choose to "watch the game" if they want

    If I understood properly, to run the signalling server I will need a dedicated server and not a classic web server right ?

    Please can I have some advice to do what I described above ?

    The signalling server is not a dedicated server for your use. It is a meeting place for peer-to-peer clients, nothing more. If you want a dedicated server, you have to set it up yourself on something like AWS (or other providers or setup your own server).

    http://gamedev.stackexchange.com/questi ... ent-server

    https://www.lynda.com/Network-tutorials ... 389-4.html

    http://www.gamespot.com/forums/system-w ... -26276019/

    https://technet.microsoft.com/en-us/lib ... 10%29.aspx

  • Ashley

    I already read the multiplayer manual entry (multiple times), but it doesn't explain how to run your own signalling server or what kind of server you need to use for this, and same problem for the "Multiplayer signalling server" Scirra store page, so it was a little confusing and that's why I asked for help ^^'

    gumshoe2029

    This is good news ! I prefer not to run a dedicated server if I can because I need to limit costs ^^

    In his tutorial, blackhornet wrote "The lobby is a dedicated server/host that must be running at all times" so I thought I needed to use a dedicated server to do that ^^' (at least that's what I understood when I read that... :-p)

    Well now I know I can do that, but I'm still confused about 2 things :

    1. How do I install the signalling server on my web server ? (as I said it's not explained anywhere I read)

    2. After installing it, what do I need to do in Construct 2 ? Do I have to connect every peer to a "global" room, and then connect them in a sub-room (I'm not sure how to say that ^^') with a limited number of places (here 2, 3 or 4) when they want to start a game together ? (and connect them back to the global room it they disconnect from the sub-room)

  • Well now I know I can do that, but I'm still confused about 2 things :

    1. How do I install the signalling server on my web server ? (as I said it's not explained anywhere I read)

    2. After installing it, what do I need to do in Construct 2 ? Do I have to connect every peer to a "global" room, and then connect them in a sub-room (I'm not sure how to say that ^^') with a limited number of places (here 2, 3 or 4) when they want to start a game together ? (and connect them back to the global room it they disconnect from the sub-room)

    1. You don't. You just use Scirra's. Ashley provides their signalling server for all users of Construct to use freely out of the goodness of his heart.

    1a. If you want your own signalling server, you must first have a server. This brings you back to a dedicated server. There is probably some programming you would have to do on the backend then. Maybe you can find an open-source signalling server? If your primary goal is avoiding backend programming, then insisting on your own signalling server is a contradictory goal.

    2. The multiplayer plugin should automatically (maybe?) connect to it to find hosts/peers. I've never used the multiplayer plugin, so I can't say for sure.

    See my links here:

    3. If you want a private tutorial on how to use AWS, I'll be happy to PM you a bunch of links to useful tutorials that I used.

  • gumshoe2029 Thx a lot for your new answer

    As I said earlier, the free Scirra's signaling server is unstable (probably because there are now too many construct 2 users and it can't always handle it) and sometimes it doesn't work for a long time :-/ (I had some issues when testing tutorial projects, etc... and I read some forum threads where others construct 2 users were having issues with their multiplayer games because of that too) so I don't want to depend on it ^^

    It's a very important project to me and I really need it to work at all times, so I'm absolutely sure I need my own signalling server to do that.

    My primary goal is not to avoid backend programming at all costs. I'm really glad Construct 2 allows me to do that most of the time so I can focus on gamedesign, etc... but if I have to code a few things to get what I need I will, I just need to learn how to do it ^^

    I'm going to take you up on that offer, I hope your tutorials will help me ^^

  • gumshoe2029 Thx a lot for your new answer

    As I said earlier, the free Scirra's signaling server is unstable (probably because there are now too many construct 2 users and it can't always handle it) and sometimes it doesn't work for a long time :-/ (I had some issues when testing tutorial projects, etc... and I read some forum threads where others construct 2 users were having issues with their multiplayer games because of that too) so I don't want to depend on it ^^

    It's a very important project to me and I really need it to work at all times, so I'm absolutely sure I need my own signalling server to do that.

    My primary goal is not to avoid backend programming at all costs. I'm really glad Construct 2 allows me to do that most of the time so I can focus on gamedesign, etc... but if I have to code a few things to get what I need I will, I just need to learn how to do it ^^

    I'm going to take you up on that offer, I hope your tutorials will help me ^^

    For starters, look up tutorials on setting up "EC2" for AWS. I would recommend Linux, but you can use a Windows server if you really want.

  • gumshoe2029 thanks a lot, I will look it up then

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)