|
|
|
|
|
by nicolodavis
2184 days ago
|
|
There is value in making the game progress client-side without waiting for a response from the server. Having the game logic run on both sides gives you the best of both worlds:
1. One authoritative version of the game state on the server.
2. Lag-free experience on the client. |
|
For example, in the online multiplayer version of Ludo I'm currently building, I trigger the die roll animation on the client but the actual dice are rolled on the server, which then calculates what moves are possible based on the game state and sends that + the value of the roll to the client. The client doesn't know anything about the rules of Ludo, it simply knows how to parse and render the move format as well as send the ID of the picked move to its source of truth (in this case, the server).
https://en.wikipedia.org/wiki/Ludo_(board_game)