Separate the Accounts, Lobby, and Game servers?

In my multiplayer game I’ve been running into to server problems. I also figure that separating the game servers would be beneficial to the project. Here is my theory:

  1. Connect to account server (Server that holds player data and accounts)
  2. After player logs in, pass that account file along to the lobby server (Server where players go when playing, but not in a match)
  3. The lobby server will add that account to the list of online players for random matches and such
  4. Then when a match is ready to begin. The lobby server starts up a new game server instance on a random TCP and UDP port to play the match on.

That would mean if the game crashes only that game crashes because technically the game server is just one game.

So how would that handle?

I’ve did some reading on ports, are they all TCP & UDP or does each port have a special protocol they like to handle?

What do you guys think?

you can do all this on one server.

Logging in could be done naively by having the client POST the login-username to an API hook on the server and have the server return an error or a success call with the User ID. From then on have the user send the UserID with every other API call. THIS IS EXTREMELY INSECURE, however, for now and for you it will suffice. You could look into doing sessions. Some languages make it easy.

You could even use Parse.com to handle most of this stuff for free. It has built in user mangement. It is owned by Facebook. And it is really easy for a beginner to use naively. Give it a shot Itll teach you a lot.

Have the user then send a POST with their userID or session token or w/e else to a “join lobby” API call. Do the matchmaking in the backend. Deal with the rest yourself.

  1. Good enough

You should be fine on any of the unreserved ports.

You seem like you have a lot to learn and are over your head. Try to make a pong game work between two computers through a server (or just between the computers even). Start small, you are trying to make a full multiplayer game and all you’ve done is “some reading on ports”

Thanks man. I’ve actually made those pong games. And I may not be ready for a big game, but I’m having fun with this project even though its an incredible challenge, I find it satisfying when I get something to work. And I am learning a lot and so far every problem I’ve ran into I have over came, so hopefully I’ll get lucky haha.

I think what The Lion King is trying to tell you is that you seem to post a ton of questions asking “how do I do this” which aren’t really answerable, since there are usually tons of different ways to do something. The only thing we can do for most of your questions is to point you to google and the basic tutorials. You ask stuff like “how do I do this huge problem XYZ” when really you need to be focusing on small problem x, small problem y, and small problem z.

It’s cool that you’re eager to talk about programming, but you seem to skip over the part where you spend time thinking about a problem and working through it by breaking it down into smaller steps. And that’s doing yourself a disservice, since that process is one of the most important skills a programmer needs to develop.