Answer the question
In order to leave comments, you need to log in
What do you need to know to write a game server backend?
As a hobby, I am developing games, I know a little junior c # (I mainly use it in writing game logic in Unity3d) and java (I use it to work with libgdx). I have basic knowledge in javascript, html and css. There is a strong desire to get acquainted in python.
So, I somehow wondered about creating my own game server (or some service located on a remote machine that processes a request from a client and issues a data set in response), but I still don’t know which way to approach this issue. In this regard, a number of questions arose:
Answer the question
In order to leave comments, you need to log in
Alexander Alexandrov is unfortunately forced to join Sergey in that you don't know what you need from the server.
You see, all these architectural patterns are "backends" in the web understanding, RESTs are all good and convenient, but the standard web approaches are not always about games and real-time applications.
You have to make many different decisions before doing anything.
> there is a server that the game application accesses to write or retrieve certain player data
This "certain data" is the whole point. It is possible to distribute logic between the client and the server in different ways, but often, especially in games where resistance to cheating is needed, most of the game logic is located on the server. This is much more than "extract player data". If the game logic is located on the server, then the requirements for the data exchange process are appropriate - there is not much sense in REST, because you still have to introduce the concept of "session" or "connection" with the server, and store its state. And your main task will not be in easy scalability to an unknown number of clients, but on the contrary, in maintaining the most comfortable gameplay for existing players, and scaling will be in second place and will be achieved by slightly different architectural solutions.
Many large game projects with a large share of logic on the server use their exchange protocols (usually binary ones) over a regular TCP connection. Many people use different languages for describing such protocols to make it easier to manage development and make changes to the protocol (for example, part of the server and client code can be automatically generated from such descriptions). For example, Blizzes, as far as I know, use Protocol Buffers for Diablo 3.
On the other hand, if your game is essentially a single-player game (like mahjong of some kind) and you only need to save statistics, without special trust requirements (ie. i.e. just for the convenience of the player), then a simple REST service is perfect for you.
you need to decide what level of trust this data has. This will largely determine the architecture. If your project is of a competitive nature, and the substitution of data on achievements or the manipulation of the results of individual games or matches can put an end to the entire project, then the client cannot be a trusted party, and the critical logic should be on the server.
Unfortunately, I cannot help with the first point, but with the second - I can advise: What you know well, write a server on that. You can even write a server in C#, Java, Python or JS...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question