Increasing MAX_VIEW_IDS

Options
I'm making an RTS game. Player's can chop down trees & destroy rocks that spawn on the map in order to gather resources. The problem is that there are probably around ~4,000 of these objects and MAX_VIEW_IDS is 1000.

The solution I think is to increase the MAX_VIEW_IDS. Is there any problem to doing this?

The only calls each resource would make it when a worker hits it, it'll tell everyone how much it has left and when its empty the host will destroy it.

So with that in mind, is there any downside to increasing MAX_VIEW_IDS ?
And if so, do you have an alternative solution?

Sincerely,
Blake Gillman

Comments

  • Hi @kriller509,

    please take a look at the Limitations section on this page.

    For your scenario I would recommend another solution. Instead of using a massive amount of PhotonView components, you can add a custom script which adds an unique Identifier to the object. This is similar to your approach but has much less overhead. Then you can use a manager, which is aware of all the resource objects, for example by having a Dictionary containing all IDs and their connected objects. To synchronize the state of a resource, you can use the RaiseEvent function.
  • @Christian_Simon
    Very creative approach. My next concern is that because this game is procedural, in order to do that I'd have to send a 2D array over the network ( int[,] resources), and due to its size (Maps being 200x200) I'm concerned this may pose a problem for the data limitations of the server. I have the $100 plan and I know I'm limited to 3GB/user.
  • If it is procedurally generated, it should be enough to simply share the seed with the other clients and let them generate the resources on their own. After this is done, changes made to the resources can be applied.

    If you want to, you can take a look at the Procedural Demo from the PUN 2 package. In this demo, we demonstrate how to handle and modify procedurally generated worlds by using the Custom Room Properties. Although it is not exact the same thing you want to have, it might give you some further insights you could use for your project.