as you mentioned I don’t need to spawn every piece in the game, can you please give me more explanation on what do you mean by communicating each players move rather than synchronizing the position???
As you’re using the Fish Game as a point of reference I’ll try to explain it with that context in mind. Fish game is a client authoritative realtime fast paced multiplayer shooter. In Fish Game, each player continuously sends their position to the server, which gets relayed to the other clients; in turn those clients update their local game visualisation to display each player in their correct position.
With a turn-based game like Backgammon, where the game is effectively “paused” until the current player takes their turn, there is no need to continuously send the positions of each player’s pieces. Instead, each client should communicate their move/action (e.g. white moves piece A to position X on the board) on their turn as I described previously with the Chess example.
is this possible with Nakama ?? since Nakama has only one way of synchronizing, send message and receive it???
Absolutely. There are two approaches you can take here. Client Authoritative where each player joins a match and on their turn they send their action to the server as an OpCode and JSON payload (again as explained above). In a client authoritative match, the server receives the message and relays it to the other connected clients. For example, Player A sends a message saying they moved White Piece A to Position X, the server receives the message and sends it on to the other clients so they can update their view of the board and know that it is now their turn.
The alternative is Server Authoritative where each client sends their message to the server, the server processes that message and chooses how to handle it. For example, Player A sends the same message as above; the server then checks to see if it is a valid move (or perhaps does something else), it then sends its own message out to the other player to let them know what move Player A made.
I would recommend reading our documentation on the Multiplayer Engine. For an example of a turn based game using Nakama you might want to take a look at our Tic-Tac-Toe Example; although written in JavaScript it may be useful. If you would like to go down the server authoritative route instead then start by taking a look at our Server Runtime Documentation.
I followed your fish game tutorial and I created something similar, I spawned to backgammon objects to the scene and I assigned each game object to a player, and if the player is the first in the session they get white pieces and if they’re the second they’ll get the black ones, and for the objects I created two one with synch remote script and one with sync local scrips, but the problem is when the game starts both player automatically synch to one position they stack on top of each other even tho I have two different spawn points??
Fish Game and Backgammon are very different in terms of gameplay mechanics and I do not believe that the state synchronisation code for a realtime shoot-em-up translates well to the turn-based board game you are trying to create. The Tic-Tac-Toe example I mentioned above would be more fitting here.