Godot Version
v4.2.1.stable.official [b09f793f5]
Question
A bit of a long read, but I think context is necessary for my questions. Still learning multiplayer… Please bear with me.
I’m working on a turn-based multiplayer game that has 2 players with 4 characters each. Currently I have this setup: upon start of the match, the host and client instantiate the 8 characters on their own respective instances. However, there are some variables that get randomized for each character upon initialization, so that needs to be synced between the host and client.
I was thinking to resolve this issue, since I’m gonna need it soon anyway, should I just create a sync function that gets called upon start of the game (after randomization of relevant stats) and after every turn occurs? I can’t wrap my head around how to implement this in code using RPCs though. Should I just let both server and client spawn their own stuff and ask the server to send an RPC to update the state of the client’s characters?
Also, while I’m here, I’d also like to ask for advice on how to implement turn queue handling. Currently, I have a working turn queueing system for all characters. (works like FF7 where a bar slowly gets filled and grants a turn when full)
But again, the filling up of the bar is handled on their own respective instances, no RPCs, (which I think should be fine, right?) and gives the turn to the first character to fill it up. Once the acting player A confirms an action, should I send an RPC to tell player B what actions need to be performed/animated/displayed? And then call the aforementioned sync function RPC to sync stats between both players?
I apologize for the wall of text, and thank you for reading through it. Looking forward to your answers, thank you!