Im switching my game to Unity and decided to use Nakama for multiplayer,
its a 2D fighting game where players log into the site, find a match (1v1) and then fight it out as a 2D sprite similar to old school street fighter.
I find Namaka matchmaking to be more than enought to do this however I am confuse on how to implement the spawning part.
In our previous implementation, after finding match the players are presented with a UI that a match has been found and they will click on “Start game” or “accept” button in UI, both events sent the message to the server and in the server, once both players accepted the match, the server ASSIGNS a player index (1 or 2) to both players, and send these player index to each player.
What this index means is when player is assigned index 1, the player character is spawned in the left position, while the other will be on the left (much like the traditional fighting game).
Im following the fish tutorial for Nakama as this is the first time ill be using Nakama, however I cant imagine how to do this as everything happened and handled at the client side when using Nakama framework and server.
Example in the fish tutorial here: Nakama in Unity #10 - Spawning Players in Fish Game - YouTube
Its the client side that decides and randomize which area the player spawns, Im not sure if i understand the code correctly but i think this is prone to sync errors. What will happen if all client decided to randomize at different location? that will result to a network object being in a differnet position in the scene!
How do you think I should approach this? Guess what im trying to achieve is spawing the player in a position or location that is decided by a central authority and in our old implementation, we used the player Index for it.