What is the proper way sending datato newly connected client

Hey there,

I'm working on multiplayer RTS game, each player can build their own buildings on the scene. I'm sending building data to other connected clients with RPC all of other clients successfully can receive that building data and able to create on their side that buildings nicely.

So I just wonder what is the proper way sending those early build data to newly connected clients, as I see ;

-I can send those RPC as buffered but it doesn't look good for that use case.
-I can send early building data from MasterClient to newly connected client as RPC in "OnPhotonPlayerConnected" event so one time RPC will sync newly connected client to current building state.
- ?

What do you suggest for this use case ?

Comments

  • Both options are acceptable.
    The first one is simpler to implement.
    But in case of too many RPC sent per one building, it may make events buffer large and new player initialization time significant.
    The 2nd option requires some effort to sync current state but does not send unnecessary intermediate RPCs.
  • Thanks for your time vadim, I already implemented 2nd option. it works fine so i'll keep that method if you don't suggest any other way :)
  • I think 2nd is the best possible option. You do not need other way if it works for you.