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.

Multiplayer Server Architecture

Discussion in 'Multiplayer' started by jachitla, Aug 4, 2015.

  1. jachitla

    jachitla

    Joined:
    Jul 13, 2015
    Posts:
    12
    Hi all,

    I have been in the process of making a unity multiplayer game with uLink + uGameDB + uLobby. I am able to set everything up locally and I can run my client scene off my device while my lobby and server builds are running on my computer.

    However, I am confused on how things will scale up. So this is my understanding: I have one amazon ec2 instance for my lobby build and one for my server build that is going to run at all times. Then clients will download the client build onto their devices from the app store. I want two scenarios for my game: 1) player presses JoinOrCreateMatch 2)CreateMatch and invite friends (this is like FunRun). In my game there will be 4-5 players max for each game. So say one game fills up. And since I want one game per server (single session architecture), does a new game automatically create a new server on a different port on my amazon instance?

    Sorry if my terminology makes no sense. I am just trying to wrap my head around all this. I have been studying these concepts for a month and feel like I am really close to having a eureka moment. Theres just one thing about all this that seems to be flying over my head. :)

    Thanks so much,
    Jason
     
  2. FuzzyShan

    FuzzyShan

    Joined:
    Jul 30, 2012
    Posts:
    182
    That's what uZone is for, basically to create server instance on your lan, you would specify port and local ip that instance would be started on.
    Ps. if this question was for uLink, you probably should ask on their own forum
     
    jachitla likes this.
  3. jachitla

    jachitla

    Joined:
    Jul 13, 2015
    Posts:
    12
    Thanks Fuzzyshan!
    I didn't know what exactly uZone was for. The whole time I thought it was something you use to geofilter players and then match them up with a close server.
    I am going to try to integrate uZone into what I have now. uZone was the missing link in the architecture I have pictured in my head! :)

    Thanks again,
    Jason
     
  4. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,758
    With Amazon EC2, you can fire up new instances when your servers reach certain CPU or Memory thresholds.
    You can create custom instances (i.e virtual machines with specific software such as uLink installed).

    When a new instance is fired up, that server will register itself with your uLink master server. (There is info in the uLink docs about this). So when a group of players are matched by geolocation, you can randomly select one of these instances or the closest instance to host the game.

    I would suggest looking at uZone and uLobby as these work well together, but once you have your EC2 instances scaling up and down as demand requires you should be good to go.
     
    jachitla likes this.
  5. jachitla

    jachitla

    Joined:
    Jul 13, 2015
    Posts:
    12
    I have just setup my uLobby server build and one game server build on a windows amazon server and was able to finally connect to the lobby from my client build off my iphone (which is a huge step forward, as I am progressing through all of networking's complexities). Its relieving to hear that you have gotten to the point of "have your EC2 instances scaling up and down as demand requires" because that is my goal.

    Correct me if I am wrong but I guess my next step forward is setting up uZone which consists of: 1)installing uzone master server on my current main amazon instance 2) including uzone api into server,client, and lobby builds
    Then to have autoscaling: 1) I would create another amazon instance 2) load a uzone node onto there as well as my server build 3) set this amazon instance as an AMI 4)Then somewhere in amazon control center, set my parameters for thresholds. Then once thresholds are broken and an alarm goes off, the AMI would be created and the uzone node on there would automatically connect to uzone master, ready for action?

    Thanks alot!
    Jason
     
  6. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,758
    To be honest I'm not very familiar with uZone and uLobby, I would suggest contacting support@muchdifferent.com, and get them to help you with your questions about it.
     
  7. jachitla

    jachitla

    Joined:
    Jul 13, 2015
    Posts:
    12
    Okay, will do, thanks anyway!
     
  8. FuzzyShan

    FuzzyShan

    Joined:
    Jul 30, 2012
    Posts:
    182
    No, uZone can do load balance for you(currently not completed in their end, so you would have to write your own), there is no amazon evolved here, basically all you need to do is to setup uzone node, and use your lobby code which connected to uzone Master to fire up and close custom instances. If you go to their support forum, there is actually tutorials and other people telling you how to setup all these stuff, it was a pain, but after that it was all good.
     
  9. ericisawsome9

    ericisawsome9

    Joined:
    Sep 5, 2021
    Posts:
    14
    could anyone send me the uZone server files? I need them to start my .bat files which point out to uZoneNode.exe and other files which I dont have. It was included in the uZone.zip, if anyone could send me it it would be very helpful