Generating actual random values...

BlitzMax Forums/BlitzMax Programming/Generating actual random values...

AvestheFox(Posted 2011) [#1]
yeah, I know that the 'random' functions in BMax cant generate actual random numbers without special hardware or something silly like that :P

but I really don't want certain things to be predictable in my game. so how can I actually generate actual random values?


AvestheFox(Posted 2011) [#2]
nevermind, I think I figured out this seedrnd function bit


Czar Flavius(Posted 2011) [#3]
Yes, seed it with millisecs.

Predictability can work to your advantage. For example, you could generate a random map and only store its seed value. To transfer this map to someone else, you only need to send them the seed value, provided their version of the program generates the map in the exact same way. The built-in generator doesn't guarantee to give the same sequence per seed on every platform, but you can get ones which do.