Answer the question
In order to leave comments, you need to log in
What should be the server side of the game?
There is a desire to make a game like "platformer" with the possibility of network play. The game should be a dynamic shooter. All connected players are divided into maps, each map has 10 - 20 players. In addition to the players on the map there will be objects of the same type - obstacles.
What the client part looks like:
1) a module responsible for drawing events on the map;
2) a module responsible for processing user actions;
3) a module for communicating with the server part.
What is the protocol of client-server interaction supposed to be:
1) the client connects to the server;
2) the client receives a copy of the map (with all objects, players, their weapons, etc.);
3) the client reports the user's actions;
4) the client receives a message about the actions of other users and updates its copy of the map.
Requirements for the server part:
1) there should be no noticeable freezes;
2) each player must have up-to-date map information;
3) reliable player statistics (number of wins / number of losses) must be kept;
4) the server part should be as compact as possible (it is planned to start with free / inexpensive hosting).
What I see approaches to solving the problem, their pros and cons
a) A socket-based server that forwards messages between players without validation. The requirements are met: 1, 2, 4 .
b)A server that checks user actions based on a card template that it stores (in RAM, ROM, DB). If stored in RAM - it may not be enough for everyone, if stored in ROM or DB - additional time.
Requirements are fulfilled: 3 .
c) A socket-based server that forwards messages between players. Validation of player actions is carried out by voting (for example, if any character is killed, each client generates the corresponding event) .
The requirements are met: 1, 2, 3, 4 .
What I'm afraid of:
1) it will be unpleasant for players to play a game that slows down;
2) players will start cheating (using weapons they don't have, etc.).
I tried to explain the problem as clearly as possible, and although it didn’t work out very well, I hope for adequate advice. What am I doing wrong, what have I not taken into account?
Answer the question
In order to leave comments, you need to log in
You are probably overestimating the computational complexity of the model. VDS for 300 rubles a month will most likely cover your needs, if you do not do too much on it. If the game suddenly becomes popular, then it will be possible to invest in a more expensive server.
Option 3 can be difficult to implement. Theoretically, this is impossible. However, with some assumptions, there are algorithms, see habrahabr.ru/post/222825/.
In principle, you can score on cheating until it becomes a problem. This will increase the chances that the game will see the light of day. guide.agilealliance.org/guide/simple-design.html
I will now say a terrible thing, for which tomorrow I am very ashamed.
Download the source code of some network game and try to delve into them. For example, the engine of the first quake is not only in the public domain, but also shoveled up and down. Not even like that. Now almost all engines are in the public domain and for free. And most of the problems voiced in them have already been solved in the standard way for them.
If the game suddenly starts to be popular, then it will be possible to invest in a more expensive server ... so far I don’t see such a need, at least it was when I played for real money at azino 777 .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question