I am working on a prototype for a multiplayer game with a client/server architecture. The game has about 200 floor tiles which change their color depending on the distance of the player to them. This change is managed by the server, which means that each floor tile has its own NetworkIdentity component. Now when I build the game and start the server, then restart the Unity editor and open a client in the edtor, my floor tiles are colored completely randomly.
After searching for a while I found the simple reason: the network ID of my floor tiles is not stored in the scene file, but assigned anew each time I open the editor. Thus, the number of IDs stays the same, but the relationships between server (built before) and client (started after restarting the editor) are random.
The easy workaround is, of course, to rebuild my solution when I restart the editor, and the IDs will be in correct order again. But think what happens when I ship this game: each time I release a new version there will be new ID orders. However, players might not update their game at once, so I need my server to know about the orderings of previous versions as well, so that players with older versions of the game can still play.
Is this observation correct? Is this an intended feature, or wouldn’t it be nice to have the network IDs stored in the scene? Did anyone else have this problem before, and what do the Unity devs think about it?
BTW, I am using Unity 5.1.3. The floor tiles are prefabs but static scene objects.