Ouguiya
New Member
- Reaction score
- 11
Hello everyone!
I wanted to ask a short question about the world editor, since recently I have found a phenomenon which I find really unnerving.
You certainly all know the "Math - Random Integer / Real Number between x and y" function, in the GUI.
It's used for many things. Random game modes, random hero choosing, dynamic and unpredictable game events and so on.
The only problem: I have been asking myself lately if the randomness is truly random in Warcraft 3.
I made a quick test to see if my suspicions were correct. I made a simple, empty map, with a single trigger, which outputs a number every 2 seconds.
Writing down the number, and measuring how many times it occurs, should show if the trigger was truly random.
There were two tests: One with relatively low boundaries, and one with high ones.
First case: Random Number from 1 - 57
Measured numbers: 127
Result: The detailed result would be very long to list. suffice to say that a total of 5 numbers never occurred once, and 4 numbers occurred 5 times (even though every number should only appear around 2-3 times, statistically)
Second case: Random Number from 1-5:
Measured numbers: 77
Detailed result:
Number 1 occurred: 15 times
Number 2 occurred: 9 times
Number 3 occurred: 21 times (!)
Number 4 occurred: 18 times
Number 5 occurred: 14 times
Now I think you will agree, that this is quite off the scale. Normally, every number should have occurred around 13-17 times at most.
If one were to play a map, where there are 5 game modes, and the game mode is chosen randomly, the players will play game mode 3 more than twice as often as game mode 2.
What I wanted to ask, is if some people have also noted this "unrandomness" of the "random" function from the World editor, or if it is even a known bug.
If so, is there any way to "trick" the system so to get a good and well balanced result, a JASS function, maybe even a complex trigger designed ONLY to spit out good random numbers, since nobody likes to have a lot of possibilities, but only few options, because the random function is messed up.
Yours,
Ouguiya
I wanted to ask a short question about the world editor, since recently I have found a phenomenon which I find really unnerving.
You certainly all know the "Math - Random Integer / Real Number between x and y" function, in the GUI.
It's used for many things. Random game modes, random hero choosing, dynamic and unpredictable game events and so on.
The only problem: I have been asking myself lately if the randomness is truly random in Warcraft 3.
I made a quick test to see if my suspicions were correct. I made a simple, empty map, with a single trigger, which outputs a number every 2 seconds.
Writing down the number, and measuring how many times it occurs, should show if the trigger was truly random.
There were two tests: One with relatively low boundaries, and one with high ones.
First case: Random Number from 1 - 57
Measured numbers: 127
Result: The detailed result would be very long to list. suffice to say that a total of 5 numbers never occurred once, and 4 numbers occurred 5 times (even though every number should only appear around 2-3 times, statistically)
Second case: Random Number from 1-5:
Measured numbers: 77
Detailed result:
Number 1 occurred: 15 times
Number 2 occurred: 9 times
Number 3 occurred: 21 times (!)
Number 4 occurred: 18 times
Number 5 occurred: 14 times
Now I think you will agree, that this is quite off the scale. Normally, every number should have occurred around 13-17 times at most.
If one were to play a map, where there are 5 game modes, and the game mode is chosen randomly, the players will play game mode 3 more than twice as often as game mode 2.
What I wanted to ask, is if some people have also noted this "unrandomness" of the "random" function from the World editor, or if it is even a known bug.
If so, is there any way to "trick" the system so to get a good and well balanced result, a JASS function, maybe even a complex trigger designed ONLY to spit out good random numbers, since nobody likes to have a lot of possibilities, but only few options, because the random function is messed up.
Yours,
Ouguiya