Y
Y
YuyukoSaigeji2017-05-24 14:45:36
Game development
YuyukoSaigeji, 2017-05-24 14:45:36

What is the best way to implement a client-server game?

I'm making a simple game (for myself) for the purpose of self-education. It is not clear what functionality the game world objects should have on the client and on the server. The same or, for example, a game object on the client carries only methods for its visualization (animation, sound, position), and on the server the object has its game parameters (how many lives it has, how much damage it does, collision calculation, etc.)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
X
xmoonlight, 2017-05-24
@YuyukoSaigeji

As I understand it: it's about balance: control of the game world <-> the amount of data transmitted over the network.
The question is good.
Therefore, an approximation is always made: an intermediate visualization is calculated on the client, and the data received on the server is always carefully checked by the server within the framework of the logic (model) of the game world. And if the deviations are too large, "cheating" is fixed, otherwise, upon receiving new positions of objects, the client smoothly, but with acceleration ("parabolically") eliminates discrepancies with the server game world: it synchronizes the current state of the server world with that displayed to the user.
This happens in 99% of cases imperceptibly to the eyes of the player behind the monitor.
On the server and on the client - it is best to duplicate the logic of the mechanics and synchronize every N-frames or forcibly on some important game events.

M
Maxim Fedorov, 2017-05-24
@qonand

In the case of running a game, it makes sense to make a thin client and a thick server. That is, try to implement the maximum functionality on the server, and use the client only for visualization

A
Alexey Epsilon, 2017-06-01
@Epsiloncool

I use Fully Authoritative Server technology in my game projects. In this technology, cheating is very difficult, and the amount of data transmitted over the network is small. All logic is performed on the server, all decisions that are essential for the gameplay are also made there. The client takes on the role of the renderer of the game world (on the server only the layout of the game world in the form of data, without graphics), also Client Prediction (that is, preliminary simulation) is performed on the client, despite the fact that if as a result of comparing the received data on the client and server a mismatch is detected, then the data received from the server is used.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question