from what i understand is Network.Instantiate will generate the increasing NetworkViewID but when the game progress we may have some objects being destroyed. In the end, the number of NetworkViewID will be more and more – is it going to be the problem (such as the performance will go down or etc) if the number goes too much ? if it is, is there any ways to use the NetworkViewID of the destroyed objects ?
Thanks,
As far as I know, Unity handles the whole thing with generating NetworkViewIDs by its own. And I don’t think that you would get performance-problems by it’s means. But if your game is going to have a lot of ViewIDs you should be sure, that they are really removed from ‘runtime’. Take a look at Network.Destroy. I think that yould help you.
To manually assign a NetworkViewID you can use Network.AllocateViewID(). However it will most likely just chose the next number in line rather than picking one that has already been destroyed.
There will not be any performance issues with high numbers on your network views though. The only way you will get performance issues is if you were to not destroy objects and you just kept creating them.
Also, it would be rather hard to achieve the roof of the network view id’s because if it is an unsigned int/long then it can go up to some number like 4,294,967,295. If you plan on making that many objects over time then you may have a situation to find a clever solution for.