Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

shadowman13131

SRand and network synchronization

This topic is 5282 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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-

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
@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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!