TheBroman90
Member
In my multiplayer game I want to make sure that all players have the same seed before spawning objects at random locations. In the hosts create event he creates a random seed which he later sends to connecting players.
When a player connects he is first sent to an empty room where he recieves the random seed from the host. After the random seed has been recieved he is sent to the game world where he should use the seed to spawn objects at the same locations as the host. My problem is that the client spawns objects at the same locations every time, like his game has not been "randomized".
I thought that maybe there was some problems which caused him to not recieve the random seed from the host. So I drew a text on the screen that tells you which seed you have. The client always had the same seed as the host. I then made one of the random objects grab the current seed in it's create event an put it in a text variable. That way I could see if the random seed was recieved before or after the objects were created. Again, the seed was correct. But the clients objects always spawned in the same location every time...
Is this the correct way to send a random seed or am I missing something?
Code:
randomize();
global.seed = random_get_seed();
I thought that maybe there was some problems which caused him to not recieve the random seed from the host. So I drew a text on the screen that tells you which seed you have. The client always had the same seed as the host. I then made one of the random objects grab the current seed in it's create event an put it in a text variable. That way I could see if the random seed was recieved before or after the objects were created. Again, the seed was correct. But the clients objects always spawned in the same location every time...
Is this the correct way to send a random seed or am I missing something?