Search Unity

Setting up an MMO Server

Discussion in 'Multiplayer' started by ZeroG677, Oct 23, 2016.

  1. ZeroG677

    ZeroG677

    Joined:
    Sep 30, 2016
    Posts:
    27
    Hey
    I'm interested on how to set up an MMO Server.
    I thought it would be something like this:

    A VPS(Or more) with the server executable running, handling all the players and connections
    A MySQL database with the player info, user files, etc. The VPS server gets the player info and other stuff from here and then sends it to all the players

    I don't know if it's right though. I need more info on how this works.
    Thanks!
     
  2. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    You seem to have the gist of it :)
     
  3. ZeroG677

    ZeroG677

    Joined:
    Sep 30, 2016
    Posts:
    27
    Awesome
    Just one more question, most MMO's also have a login server. Is this in a separate VPS? Is it another executable? Is it necessary?
     
  4. ZeroG677

    ZeroG677

    Joined:
    Sep 30, 2016
    Posts:
    27
    How do i communicate with the MySQL Database in an Unity exe(The one in the VPS)?Do i need to setup something else?
     
  5. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    In my opinion, that stuff is for big MMORPGs with teams of developers, server admins and lots of cash. If you want to do what WoW does, it would probably take you a decade if you work really fast.

    Indie MMOs don't fail because the server doesn't support thousands of concurrent users, or because the client has only 50 instead of 60 fps. They fail because the task is too huge for one developer. The trick is to keep things as simple as possible so that you can at least launch your game within a reasonable amount of time. Who cares if it only supports 500 concurrent users on one server? At least you launched it, people can play it and you can earn some money to finance the next few years of development.

    What I did in my uMMORPG asset is keep things as simple as possible:
    • Instead of MYSQL I used XML to avoid setting up and maintaining an extra database server. C#'s XML also allows you to save objects and lists of objects to XML without you having to do any extra work. And it's humanly readable, easy to backup, etc.
    • Instead of a Login server, I validate the login directly in UNET's NetworkManager. You could use a simple HTTP POST/GET to your website too.
    • For server instances you should wait for UNET's simulation server. Developing and managing server instances all by yourself would take a lot of your time, which is better spent on the actual game.
     
    Last edited: Oct 25, 2016
  6. Hayz0rx

    Hayz0rx

    Joined:
    Apr 2, 2016
    Posts:
    34
    It's mostly a standalone service executable. You can run it on the same hardware as the other servers, or host it on a different one.
    By using the mysql protocol. You can write something from scratch or use an existing library.
     
  7. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    The MySql.Data.dll library from oracle is a reasonable library and the MySqlHelper class makes life very easy.

    Remember to add I18N.dll and I18N.West.dll to your builds, otherwise you'll get errors.