Best Approach for Multiplayer Chess Using Coherence.io: Distributed Authority, Game States, and Disconnection Handling

Hi,

I’m planning to develop a multiplayer chess game using the coherence SDK in Unity and could use some advice on the best networking approach. Since chess is a turn-based, deterministic game with no physics, I’m considering a lightweight approach and have a few specific questions about using coherence features effectively.

  1. Distributed Authority vs. Server-Authoritative Setup:
    Is it viable to use distributed authority to manage game states and timers in a chess game, or would a server-authoritative setup be more reliable? I understand chess doesn’t require complex physics or real-time simulation, but I want to ensure fairness and consistency across clients. What are the pros and cons of each approach for this use case?
  2. Sending Player Actions as Networking Commands:
    Since chess is deterministic, would it be sufficient to send simple networking commands for each player action? For example, transmitting a move like “Player A moved piece B from square (1,2) to (1,4)”? Would this approach minimize bandwidth while keeping clients in sync, or are there better ways to handle game state updates in coherence? Should I use the CoherenceInput component for this, or is there a more suitable method?
  3. Handling Player Disconnections with Distributed Authority:
    If I use distributed authority, what happens when a player disconnects mid-game? How can I ensure the game state remains consistent, and what’s the best way to handle reconnection or resuming the game? Are there specific coherence features or patterns (e.g., rollback, state synchronization) that can help manage this?

I’d love to hear your insights, recommendations, or any examples of similar turn-based games built with coherence. Thanks in advance for your help!

Hey, unless you are building an extremely competitive platform for chess, distributed authority is the right approach and much less complex to implement.

  1. If you assume the vast majority of players are not maliciously manipulating net code (99.999% of games) then you can certainly use a distributed or single client authority setup. It will be plenty consistent given your implementation for a location game is consistent.

  2. Yes, this would be sufficient. Have one client be the game authority and send commands for the moves and game state changes. No need for coherence Input, unless you wanted to some crazy stuff like having 100% realitime player interactions synced, like “I pick up a ■■■■ and think about moving it and wave it in the air a bit and ultimately don’t make the move”. If you want those kind of interactions synced you can take a more complex approach where each piece is a networked entity.

  3. Checkout out persistent entities and auto-adopting for a distributed approach: Authority transfer | coherence Documentation