I started converting my game from offline to multiplayer and I ran into a question around how to best structure my game given replication and multiplayer.
My game is procedural generated and so maps are generated based on a seed. The question I have is regarding how to best structure my game so that when players join the game they get the generated map and have everything ready replicated locally before they can spawn.
As a first attempt I was replicating all tiles from the map as well as the location of the spawn points, enemies, etc. The issue I face is that I can’t really tell when everything has been completely replicated and so I see that my game tries to spawn before the spawn positions have been replicated for example.
I tried adding a boolean flag that is replicated so that I know when the map has finished generating on the server and this helps in the listening client but it doesn’t help the player that joins later.
Any tips on how to best structure this or on ways you guys solved a similar problem where you need to make sure everything replicated before 'starting’the game for the clients?