Answer the question
In order to leave comments, you need to log in
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:
Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question