SRand and network synchronization

Started by
4 comments, last by shadowman13131 20 years, 3 months ago
Hey, If I seed both a client and a server with the same seed in SRand, never calling SRand again, and both run some version of windows and call rand() the same number of times, the two rands will be synchronized, correct?
Advertisement

Correct, if they''re using the "same" rand function.
rand() is not a windows function so both programs should be linked to the same version of the standard libraries.

-Morten-
Yep. If you''re going to port it to different platforms, you should use your own to make sure it''s always the same. Better yet, use this one. It kicks rand''s ass.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.
@smart-idiot:
wow; i have heard of marsene twister a long time ago, but each time i looked in the implementationi said: "what, this thingy with this ton of code should be faster than rand()" - but, they are claiming on their site that it''s four times faster ?!?!?!!?
is this true - have you tried it ?


DJSnow
---
this post is manually created and therefore legally valid without a signature
DJSnow---this post is manually created and therefore legally valid without a signature
I''ve tried it, I use it, I love it.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.
Oh, and most of that code is only executed every 600 or so calls. For the most part it''s just a bunch of bitwise operators.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.

This topic is closed to new replies.

Advertisement