- Home /
How can I make clients all use the same seed?
So I've got a little multiplayer basebuilder game that generates a random seed everytime the game is started, but the clients have different seeds, and therefore see different things. Basically those first three lines should run on every client, but all do the exact same thing instead of generating different numbers and such. I worked a little bit with Unity's networking about a year ago, but haven't touched it since then, so I've got no idea what's going on.
void Start()
{
//Generates all the background objects, this should be the same
//across all clients.
GenerateSeed();
GenerateTiles();
GenerateRocks();
//Creates representations for the player's viewing delite.
if (isClient)
{
RenderChunks();
}
}
Someone needs to be authoritative over that seed. Is the users connecting to a host client? If so, check if client is a host, generate the seed, then when the other clients connect, the host gives it to them.
Could you write a more descriptive answer of how I could do that?
Your answer
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
OnServerStart not being called in standalone build. Works in editor. 1 Answer
RPC ordering details 0 Answers
[UNET] Only spawn certain server objects on local client? 0 Answers
Networked Animation 0 Answers