Hey everyone, I'm creating my first multiplayer game with Mirror, and would love some pointers on how to organise it.
It's an RTS game with a procedurally generated world. There's a finite amount of islands, each with random surface and different units on it.
Since the islands are procedurally generated, I only need to sync the world seed at game start, and the client will know how to create each island's mesh etc, and does so automatically.
Once created, I would like the Island : NetworkBehaviour script's variables to be synced with the server (SyncVar), to be able to independently affect weather etc on each island.
I also want to save the state of each island and then load it again the next time the server starts.
This all sounds very simple in principle - naively, I'd make a SyncList<Island> islands, create the game object on the server, populate its Island instance with the save state, and then use NetworkServer.Spawn to spawn the object on all clients.
However, I read that GameObjects are dangerous in SyncLists, and I'm not even sure if I can put the Island script as a reference. So how do I create a connection between the object on the client and my save data tree which has a reference to each island and its settings?
How is this mapping from save game data to GameObject and vice-versa usually done? What would you suggest in my case?
Thanks in advance for any input 😊