Yes, but with nothing useful. It is seeded with the MINUTE. More useful would be to seed it with radio noise AND let the devs set a seed value for deterministic randomization.
The easiest thing to do to fix the problem is call this once at game start:
Calls the random function once with values that are outside the deterministic world of the computer.
Acceleromter data is going to be subtle and different each time you hold the device. This "outside noise" is going to create a chain of random numbers.
Of course this only works for devices, computers and web browsers return 0 for accelerometer data.
Option B is to keep calling random inside a timer on the title screen. Since everyone presses start at slightly different moments the random function will have been called a non-deterministic number of times, thus seeding the chain.
If you only use random in a static way above, you will always get the same results throughout your app.
Pulling from my limited Java knowledge, a random generator uses the last value as the seed for the next value, so forcing it to look at a "non-deterministic" variable preps the remaining static calls to the generator with a unique'ish starting seed. I think I got it now...
Correct, except you only need to seed the chain with a non-deterministic value, or call random with static values a non-deterministic number of times before game start.
Once this "seed" is done you can call random with static values.
I'm surprised that GameSalad doesn't access the system clock. By using seconds, the random function could be more random. Plus, it could be used in the app to create some other dynamic effects... like how World of Warcraft is on a 24 hour schedule.
Comments
The easiest thing to do to fix the problem is call this once at game start:
Random(-abs(accelerometerX * 100), abs(accelerometerZ * 100))
Acceleromter data is going to be subtle and different each time you hold the device. This "outside noise" is going to create a chain of random numbers.
Of course this only works for devices, computers and web browsers return 0 for accelerometer data.
Option B is to keep calling random inside a timer on the title screen. Since everyone presses start at slightly different moments the random function will have been called a non-deterministic number of times, thus seeding the chain.
So, it took me a while to get it...
random(1,100)
If you only use random in a static way above, you will always get the same results throughout your app.
Pulling from my limited Java knowledge, a random generator uses the last value as the seed for the next value, so forcing it to look at a "non-deterministic" variable preps the remaining static calls to the generator with a unique'ish starting seed. I think I got it now...
Isn't the first clock tick always 0.001?
I'm not following you.
Correct, except you only need to seed the chain with a non-deterministic value, or call random with static values a non-deterministic number of times before game start.
Once this "seed" is done you can call random with static values.