A
A
Alexey Lizurchik2015-10-19 10:14:26
Game development
Alexey Lizurchik, 2015-10-19 10:14:26

How to design an authoritative game server?

Good afternoon. For learning purposes, I want to figure out how a reputable game server should work and in what cases it is needed at all. The game for learning is primitive: space, ships. They can fly and shoot at each other. By now, a lot has been googled and read, but questions still remain:

  1. What are the ways to ensure the same (at least approximately) ping for all clients?
  2. How should the server handle one ship firing at another? Specifically, I'm interested in whether the server should already know at the moment player A is shot whether player B is killed and send him a corresponding message in order to draw a decrease in health? Or should he (server) know about it only when player B sends the event "I was hit" and then check if he was shot and send the result of "shooting" to the client (player B)?
  3. How to organize the synchronization of AI actions between clients? Who (server or one of the clients or someone else) should regulate the actions of AI and notify other clients about it?
  4. How do you design instant synchronization and processing of actions between clients? For example, in MOBA games everything happens quite quickly and sometimes it happens that it is necessary to synchronize some action that takes place in half a second, or even less (for example, someone jumped and was frozen). What data transfer protocols are used in this case and what should be the procedure for communication between clients and the server?

Please, if possible, provide detailed answers, or links to resources related to specific questions. I repeat that I have already read quite a lot of both English and Russian-language resources, but some kind of mess and misunderstanding are still present.
Maybe there are patient people among users who are ready to help with explanations beyond the scope of the toaster? Leave contacts if you have the opportunity to chat.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2015-10-19
@likerRr

1. Nothing. But many games have a certain critical ping, above which it is uncomfortable to play.
The way out is to initially design the game mechanics in such a way that the popular ping (up to 10-20 ms) is more or less comfortable.
2. You have a bit of a mess even in the way you describe the game. Is it a shooter, is it a real-time strategy game, is it a simulation? Everyone has their own features, but even 50 ms is enough to more or less adequately keep up with rendering. In most cases, the client draws non-critical things immediately after the action, and when receiving a confirmation response from the server, it already completes the more critical ones (for example, you can reduce life immediately, but you can destroy the ship only after confirmation from the server).
3. Of course the server must regulate the actions. All critical things should be calculated on the server. The client can do predictive calculations that duplicate what the server does, but only in terms of rendering. For this, the algorithm must match. But confirmation from the server is required. Otherwise, any student will be able to hack such a game with fake packages.
4. There are only 10 players in MOBA games. There is a lot of time between instant and fast synchronization.
For example, a player from Russia is comfortable playing on Russian and European servers. And on the American ping over 20-30 is already VERY noticeable.
The protocol is of course UDP, what else.
Optimization - reducing traffic, think through as much as possible what exactly should be transmitted, build on this in mechanics.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question