RPC Question!

Hello everyone, this is my first question on this forum! :D

So the problem we got is that when a player disconnects all RPC's called from that player are lost.
Now in our game we want people to jump in and out of games and get certain updates even from players who left.
The updates we need to remain are changes to our voxel world, where coordinates of collisions are send to all to destroy/build the level at these positions, and thereby sync the level. The best solution we came up with so far is having the master client handle all of it, but then when he leaves everyone disconnects.

Is there any way around this? Can i use a sceneView to send RPCs or something like that?

Kindest regards BFGames.


  • Tobias
    Welcome on board!

    I think I get the idea of what you want to do but there are 2 hurdles:
    a) By default, Photon deletes the buffered events of players when they leave. You can disable this via PhotonNetwork.autoCleanUpPlayerObjects = false.
    b) The bigger problem is: All RPCs, even for the same coordinate, will all stick to the room and not be cleaned. If the game goes on, you get an infinite amount of data that needs downloading when someone joins. This breaks at some point.

    I don't know how much info you need to save at max but you should give properties a try. Properties can stick with the room until it's empty and even better: You can update them. However, they need string keys, which is some overhead again.
    You could do a test with the max amount of data you want to set and let a test client join and see if that works for you. Then you could use properties as world state.
  • BFGames
    Thanks for the info, helped a lot!

    The game is a fast paced side scrolling shooter, with a frag limit or capture the flag limit. So the game time is very limited. But in this manner we can keep the level synced even if the master client leaves which is very cool.