Syncvar on procedural tiles

Hello, everyone, it’s my first attempt on designing a multiplayer game.

I have a working lobby, the players are in sync as well.

The hex tile gameworld is defined (size, random seed …) in the lobby. Every client then generates the same world. Here is the problem: If I change a variable on one of the tiles (for example the integer representing the climate), the change remains local. I have used Syncvar which works fine for anything else but the tiles.

I guess every player has a similar looking gameworld but because of the way I generate them, the tiles are all local? What is the best way to synchronize them?

GameObject hex_go = (GameObject)Instantiate (hexPrefab, new Vector3 (xPos, 0, y * zOffset), Quaternion.identity);

I was finally able to solve the problem.

The map is generated on the server only now. When the map is completed, it is spawned by some very simple code:

	foreach (GameObject tile in tiles) {
			NetworkServer.Spawn (tile);

I also changed all player actions to commands. The server is now changing tiles if necessary and shares the information by the use of SyncVars.

After I figured it out, it seems quite obvious and easy to me and I feel capable to finish the development. But first I have to call my friends - it’s time for them to suffer … <^;…;^>