- Home /
Synchronizing Game State Via RPCs
I've tried googling around for this, but I've not had much luck. So, I apologize if this has been touched somewhere else already.
I have a game that is using RPC calls between two peers. One is actually the Server and the other is the Client, but the information is propagated as though they're peers.
Most of the time the information gets passed back and forth to each other correctly, however there are times where the state of each will be synched incorrectly.
This causes one player to be in one phase, while the other player is in another phase.
Is there a technique that would allow me to make RPC that represent the state of each player, and to do it in such a way that reliably allows each player to move to the next phase without leaving the other player behind. I'm not interested in using the state synchronization with Unity, rather I want to try and do it with RPC calls.
Is there a way to guarantee that my state I have for one player is accurately reflecting the state of the other player so I can move forward into other logic?
If you could provide any technique names, information, or examples on this it would truly help me get over the last hurdle I have with this game.
Basically, my phases serve as a marker for my logic to run certain actions in certain ways. So both players are in draw phase, player one draws, player one is waiting for the other player to draw, then one player moves from draw to summon phase. So now you have two players: player one in draw phase and player two in summon phase.
Both players are sharing the same information every RPC call, just the phasing deter$$anonymous$$es how to move the logic along so that the players are on specific log steps.
$$anonymous$$y issue is that my logic will push one player into another phase and because of that the logic from the other player will not be triggered to move to the new phase because their information wasn't matched up for one of the players and the other player moved forward.
Does that make any more sense?