0

I have a game that contains more than 5000 cubes. Once a user creates a room, cubes are created (new arrangement every time the game is played). I would like to be able to transfer a position list (vector3 list) of the created cubes to the server so whoever joins the same room will run a function that will instantiate cubes and arrange them based on the list on the server.

Max Yankov
  • 12,551
  • 12
  • 67
  • 135
AndTy
  • 1
  • 1
  • What have you tried so far, and what problems did you encounter while doing this? Stack overflow users can answer your questions and help with your problems, but we will not just write the code for you. – Max Yankov Apr 19 '15 at 08:24
  • Thank you golergka, I need some directions on how to achieve this. I have tried using the OnPhotonSerializeView() but this is a continuous feed of position and I am looking to send position list/data of +5000 cubes only once by the first user who create the room and then have the position list available to be used by other users who join the same room. I have also tried attaching PhotonView script to the prefab and observe the position of every cube created, but I get and error as I run out of View ID's. These are my attempts so far. – AndTy Apr 19 '15 at 17:00

1 Answers1

0

If the cubes are going to be static you can do below way to avoid sync of those many positions initially.

When creating a room, create a random value for seed and save it in room properties.the random value can be tick count for instace. With this seed you can create the positions of the cubes completely local.

On giving more details i will update my answer.

For the current case, as you need same setup for newly joined players, instantiate with buffered flag in master.

Ayyappa
  • 1,876
  • 1
  • 21
  • 41