Advertisement

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

Started by July 22, 2018 09:19 PM
3 comments, last by KVADRO 6 years ago

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.

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

Thank you :)

Each of those things are potentially enormous.

You've got a few paragraphs of concept, but the devil is in the details.  It's like showing a page of book ideas and asking if the full-length novel you're planning to write will be any good.

Those are things your game needs, yes. You can write them yourself -- many people have done that -- or save yourself hundreds of hours by reusing someone else's parts.  

Advertisement

Well, it's just a concept, I just want to make sure I'm in the right path.

Anyway, I've been checking Photon and UNET, none of them seems to be able to do what I want to, that's why I decided to code all that structure by myself, I know it's a hard work, but just in case, do you recomend some platform that would support my concept? Everything I saw for now is all client based, I want an authoritative server, with all the logic on it to be hack free, etc.

Hi Maozao. 

You can consider Player.IO. In Player.IO you can host your own room logic on their servers, witch allow you to run authoritarian logic. It rather cheap for indies, and provide good functionality. But, i noticed that they have minor bugs in their SDK.  

This topic is closed to new replies.

Advertisement