Practical multiplayer implementations
There are three main approaches towards multiplayer among game developers - Peer to Peer, Client authoritative and Server authoritative.
At Elympics we support and require Server authoritative approach as it has many important advantages above the other implementations, making it the only choice for e-sports and play-to-earn games.
Peer to Peer
Very basic, naive solution. No server is required. Suitable only for playing within a single WiFi network, or with a Bluetooth connection. The amount of transferred data increases significantly with more players thus this solution is rarely used in practice.
Client authoritative
A client-server architecture where clients (players) have the overriding role in arbitrating the game, which implies the possibility for players to cheat. The client, having control over the arbitration, can freely modify the state of the game without any validation from the server.
The server only plays the role of a "transmitter" of information — no code related to the game logic is executed on it.
The biggest advantage of this approach is that it requires no server infrastructure - one of the clients can take this role, saving up on maintenance costs.
The unacceptable disadvantage in e-sports or play-to-earn games is the susceptibility to cheating by the lack of full verification of clients’ actions.
Due to the lack of an arbitrator, the game developer is responsible for synchronization and resolving potential conflicts.
In this example, it is the client that sends the new coordinates, without an external referee. This allows them to send arbitrary values even though, according to the exemplificatory game rules, they should actually be able to move only one point.
The solution would be to delegate their role in refereeing the game to the server, so that the state they send is validated by the server and does not allow players to modify it against the game logic.
Server authoritative
However, non of the solutions above is capable of ensuring fairness. This means that if you want to create a play-to-earn game where players are rewarded for their achievements during the gameplay, you only have one option and it is the server authoritative approach