- Mark as unread from here
- Posted: 11 years ago
- Modified: 3 years ago
-
Post #1
The purpose of this post is to show that the site's dice generator produces rolls that come very close to the calculated probabilities and to help players better understand the nature of randomness.
Randomness and Probability
We start off with a simple coin flip. Everyone knows that when a proper coin is properly flipped there is a 50% chance of it being heads and 50% chance of it being tails. Yet flip a coin ten times and see how often you get 5 heads and 5 tails. On average it's only about 25% of the time. This means that most of the time you don't get what you expect in the short term.
But if you flip a coin 1,000 times you should expect to get pretty close to 500 heads. But it won't be exactly 50%. You would have to flip the coin an infinite number of times to get the percentage to 50%.
This small program I wrote demonstrates this:
https://dominating12.com/coinflips
Open it up in a new tab and refresh it a couple times. You will see that the results vary greatly in each set of 10 flips but after 100,000 flips the percentage gets pretty close to 50%.
Our dice
The site uses php's built in mt_rand function for randomly choosing a number between 1 and 6. Many players have called in to question the results of our implementation stating that they think there is something wrong with the dice that causes them to get really bad rolls. So I wrote a program to generate thousands of rolls to see if the results are accurate.
According to Wikipedia and other sources, when attacking with 3 dice vs. 2 dice the defender is supposed to lose two armies 37.17% of the time. The attacker is supposed to lose two armies 29.26% of the time and each loses one army 33.58% of the time. The attacker should win 53.96% of the rolls.
My program will show its results followed by the above calculated probabilities in parentheses. You will see that with only a few rolls there is a lot of variability. You may think that this degree of variability is a mistake but it is in fact the very nature of randomness. You will notice the other half of the nature of randomness by looking at the results after 100,000 rolls; the program never fails to get close to the desired results. Keep in mind that it would take an infinite amount of rolls to guarantee that the program hits the percentages exactly.
https://dominating12.com/dice
Conclusion
Why do players keep complaining about the dice when they are very accurate? The problem is that what they expect and what they get are two different things. They expect to win 54% of the rolls in every battle. But that is not how randomness works. Some of the time players get really good dice and some of the time they get very bad dice.
But why do players think that the dice are broken and produce bad dice more often than good dice? This is more of a psychological problem than a technical problem. The fact is that we remember the bad more than the good. And even worse, we speak about the bad dice more than the good.
I did a search of all the chat in all the games and found thousands of mentions of bad dice but only a few mentions of good dice. Since I have proven that our dice are accurate then the conclusion must be that our players human brain's are the problem and not the computer.
Please do me a favor and point people to this post whenever they complain about the dice.
Better Dice?
I personally would prefer dice that behave more predictable so that I can calculate my moves more accurately. I think that the game would be better with less randomness. I don't believe that all randomness should be removed, however. That is part of the fun. But the dice should be programmed to give you something close to what you expect most of the time. We do have plans to have a game option for fake dice. The fake dice would double the chances (making it 67%) that both the attacker and defender would lose 1 army in 3 dice vs. 2 dice battle. It would not, however, change the attackers advantage. The attacker would still win 54% of the rolls on average. I think that this would solve most peoples problems with the dice.
Randomness and Probability
We start off with a simple coin flip. Everyone knows that when a proper coin is properly flipped there is a 50% chance of it being heads and 50% chance of it being tails. Yet flip a coin ten times and see how often you get 5 heads and 5 tails. On average it's only about 25% of the time. This means that most of the time you don't get what you expect in the short term.
But if you flip a coin 1,000 times you should expect to get pretty close to 500 heads. But it won't be exactly 50%. You would have to flip the coin an infinite number of times to get the percentage to 50%.
This small program I wrote demonstrates this:
https://dominating12.com/coinflips
Open it up in a new tab and refresh it a couple times. You will see that the results vary greatly in each set of 10 flips but after 100,000 flips the percentage gets pretty close to 50%.
Our dice
The site uses php's built in mt_rand function for randomly choosing a number between 1 and 6. Many players have called in to question the results of our implementation stating that they think there is something wrong with the dice that causes them to get really bad rolls. So I wrote a program to generate thousands of rolls to see if the results are accurate.
According to Wikipedia and other sources, when attacking with 3 dice vs. 2 dice the defender is supposed to lose two armies 37.17% of the time. The attacker is supposed to lose two armies 29.26% of the time and each loses one army 33.58% of the time. The attacker should win 53.96% of the rolls.
My program will show its results followed by the above calculated probabilities in parentheses. You will see that with only a few rolls there is a lot of variability. You may think that this degree of variability is a mistake but it is in fact the very nature of randomness. You will notice the other half of the nature of randomness by looking at the results after 100,000 rolls; the program never fails to get close to the desired results. Keep in mind that it would take an infinite amount of rolls to guarantee that the program hits the percentages exactly.
https://dominating12.com/dice
Conclusion
Why do players keep complaining about the dice when they are very accurate? The problem is that what they expect and what they get are two different things. They expect to win 54% of the rolls in every battle. But that is not how randomness works. Some of the time players get really good dice and some of the time they get very bad dice.
But why do players think that the dice are broken and produce bad dice more often than good dice? This is more of a psychological problem than a technical problem. The fact is that we remember the bad more than the good. And even worse, we speak about the bad dice more than the good.
I did a search of all the chat in all the games and found thousands of mentions of bad dice but only a few mentions of good dice. Since I have proven that our dice are accurate then the conclusion must be that our players human brain's are the problem and not the computer.
Please do me a favor and point people to this post whenever they complain about the dice.
Better Dice?
I personally would prefer dice that behave more predictable so that I can calculate my moves more accurately. I think that the game would be better with less randomness. I don't believe that all randomness should be removed, however. That is part of the fun. But the dice should be programmed to give you something close to what you expect most of the time. We do have plans to have a game option for fake dice. The fake dice would double the chances (making it 67%) that both the attacker and defender would lose 1 army in 3 dice vs. 2 dice battle. It would not, however, change the attackers advantage. The attacker would still win 54% of the rolls on average. I think that this would solve most peoples problems with the dice.