Synchronization question

Options
I have a scene with a large number of runtime instantiated network scene objects on the MC. When a new player enter the room those objects will automatically get instantiate on the client's scene by Photon. My question is will it become a problem for the client to handle all the instantiations? Will it run out of buffer/processing cycle? If so, is there anyways to get the instantiations of network objects to happen across a period of time, rather than instantaneously?

Thanks
David

Comments

  • cyberswine
    Options
    A follow up question is how can the MC know that all object instantiations on client side are completed?
  • Hi @cyberswine,

    I have a scene with a large number of runtime instantiated network scene objects on the MC.


    What do you exactly mean by 'large' number? Is there a way to place those objects at editor-time instead of runtime?

    My question is will it become a problem for the client to handle all the instantiations?


    Hard to say. I currently don't know, if Unity has some automatic object pooling by default. If there isn't such a thing, an Instantiation call is always very expensive since Unity needs to ask the OS to get some memory and the OS itself needs to allocate some free space. This process takes some time. It is mostly the same when Destroying objects. Worst case is, that the client gets disconnected from Photon due to a timeout, but I guess this shouldn't happen on most of the supported platforms. WebGL might get some problems with this.

    If so, is there anyways to get the instantiations of network objects to happen across a period of time, rather than instantaneously?


    I think there is no other way. When joining the room and there is no need to load another scene (automaticallySyncScene) the clients starts working on the received message queue with all the buffered Instantiation calls inside.

    A follow up question is how can the MC know that all object instantiations on client side are completed?


    Honestly I think he can't by default. You can implement some crazy stuff to achieve this behaviour but this will somehow longer the whole Instantiation process and is more counterproductive than helpful.