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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

[Help] Game Server Structure - What do you think about my concept?

Discussion in 'Multiplayer' started by maozao, Aug 1, 2018.

  1. maozao

    maozao

    Joined:
    Jan 20, 2016
    Posts:
    12
    Hello.

    I'm developing an online card game (Heartstone like) concept.

    But I have some doubts about the server structure that I'll use, I'm gonna describe the initial structure to you guys.

    1- Login/Data Server (public)
    2- Matchmaking Server (private)
    3- Game Server ("public")

    The client will connect to the Login Server using the user/password, after the success authentication a TCP/IP connection will be opened between the client/server, where the client will receive the user profile, used decks, cards, etc, where the client will be able to change the cards in the decks, the "hero" used, etc, all those requests will be handled by this Login/Data server.

    After click in the "Find Battle" the Login/Data server will receive those requests and internally communicate with the Matchmaking server, that will add the client in a game search Queue.

    The Matchmakign server will have this game Queue, with its own logic to find 2 clients with the "same" game power and will notify the Login server about the matchmaking result, after that the MM server will notify the Game SErver to create a new Game session related to those 2 clients. The Login server will notify the 2 clients, sending them the game server IP to connect, the game session ID, session password, etc.

    The clients will send a request to the Game Server with the session ID and password so they can "authenticate" in the game server, creating a new TCP/IP connection with the game server, that will receive/send the game requests like drop X card, attack X card, skip turn, etc, when the game ends, the connection will be closed, and re-openning a connection with the Login/Data server again. (Not sure if I should close the first connection and reconnect like this, or just keep the Login/Data server connection opened while playing a game).

    I kinda like this structure that I tought, this way I will be able to scale the server in case of too many users, since the connection IP's will be given based in the "Load Balancer", and internally controlled by the Matchmaking server about the Game Servers loads, that will have N active game sessions.

    Keep in mind that all the servers will be writen by me, I will not use any third part servers like Photon, UNET, etc, since they aren't that configurable as I want to, and too much client-side.

    Here is an image of the prototype:

    ServerArchteture.jpeg

    I would like to hear your opnions about this structure, what I could improve and/or take care.

    Thank you
     
  2. Jos-Yule

    Jos-Yule

    Joined:
    Sep 17, 2012
    Posts:
    292
    maozao likes this.
  3. liquify

    liquify

    Joined:
    Dec 9, 2014
    Posts:
    172
    It's good but it is abandoned since the developer made it free. It is also difficult to customize, if I want to add more (change some) features. If the owner of the thread can make his own master server applications with .NET Framework or Java, I think it would be better than using Unity as server applications (e.g. Master Server Framework and Master Server Kit assets).
     
    maozao likes this.
  4. maozao

    maozao

    Joined:
    Jan 20, 2016
    Posts:
    12
    Yeah I saw it's abandoned, but since I'm already writing the servers I wouldn't use a third part for now, unless I start to have some crazy problem.

    The main point of the thread, is just to check if my server structure looks fine and/or if I'm missing something.

    Thank you all for now!
     
  5. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I'd only do it this way if your plan is to be able to have multiple Login servers. Otherwise I don't see why the Login server couldn't perform all of the work that the Matchmaking server is performing and save a bunch of back and forth chatter between those two servers for what seems really a rather trivial amount of processing that the Matchmaking server is performing.

    I would assume there is also some kind of database with accounts and card inventories owned by the player that all of these servers will need access to.