Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Small scale server?

Discussion in 'Multiplayer' started by Tharkis, Mar 14, 2012.

  1. Tharkis

    Tharkis

    Joined:
    Mar 7, 2012
    Posts:
    16
    So I'd like to have a game where there are a limited number of players on a server. Let's go with 64 players for the sake of this conversation but I suppose it could be as large as 128. The whole concept would be that players could host their own servers, and use a master server concept to allow them to "travel" to other realms (player hosted servers). The traveling would entail transferring the player's stats and inventory to the new server as well. So I would imagine the server needs some way to store this information at least for the duration of the player's stay on the server.

    Now then, what should I be looking at as far as the server goes? I'd want something that can be distributed with the game so the players can host the server. Any thoughts on this would be appreciated.
     
  2. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    Basically you will need to write it yourself because what your asking doesn't exist.
     
  3. Tharkis

    Tharkis

    Joined:
    Mar 7, 2012
    Posts:
    16
    Weird, I mean it seems like an old concept.. Well except for transferring inventory, but even that seems like something people did back in the old battle.net days with diablo.. The master server deal has been around since quake. I'm sure I can figure something out. Anyone else have any ideas?
     
  4. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    Keep in mind that the 'masterserver' is not really a game server, it just connects client games to eachother.
     
  5. Tharkis

    Tharkis

    Joined:
    Mar 7, 2012
    Posts:
    16
    Yeah, I might be getting my terminology a bit mixed up here. The clients would use the master server essentially to pick and choose where they want to go. But the servers themselves would be a part of the game. Similar to hosting your own quake server. It sounds like I might just have to look at rolling my own solution.
     
  6. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    Maybe you should read about the Unity masterserver or try it out so you see what it does. Writing your own server with the knowledge you have now is just not going to happen.
     
  7. RingOfStorms

    RingOfStorms

    Joined:
    Oct 23, 2010
    Posts:
    584
    Yea for what you want you are going to be doing something similar to what im trying to achieve. If your familiar whit Minecraft, their servers are basically public and whoever hosts one can host one simply by double clicking the server.jar.

    For you, you would want to have each server contact a master server, that way each server is in a way "connected" and clients can get a list of them all in game. But you would have to write the server by yourself, then write a simple master server that you host for each server to connect to.

    To transfer the invetories you will need some type of database, like XML or MySQL. When a player switches that data would need ot be sent with the player, either by the client or the server. In either case the database should be encrypted to prevent players fmr editing their invetories.
     
  8. npsf3000

    npsf3000

    Joined:
    Sep 19, 2010
    Posts:
    3,830
    uLink is the closest fit I can think of.

    Allows both self-hosting and inter-server transfers.

    Don't think that it's going to be easy though.
     
  9. Tharkis

    Tharkis

    Joined:
    Mar 7, 2012
    Posts:
    16
    So in essence, there would be 3 pieces. I'd have my Master server which essentially collects server names and IP addresses from the Player Server. The client would then connect to this Master server to pull a list of names and IP addresses. This seems simple enough. Might even be done with php and a mysql database.

    I'd have the Player server which actually hosts the game and controls the inventory. This server would pass data back and forth to the database for all the players connected to the server. As you suggested, the database would have to be encrypted and probably the communication as well so no one was tampering with the inventory. It would probably have to do some sort of authentication, if only a password so players could make their servers private.


    Finally I would have a client which connects to the player server.

    After sort of working this out in my head, maybe this isn't really the way to go. What would be involved in setting up 1 server but having persistent "instances"? Same theory, but the players would not be hosting their own servers.