Dice randomness

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Dice randomness

Ajmdemen
Hey,
I was wondering how does the engine actually determine dice rolls. Is it truly random? I recall cpu's often generate flawed results, but that there are methods to improve this. Anyone spared this one a though?
Regards,
Ajm
Reply | Threaded
Open this post in threaded view
|

Re: Dice randomness

Veqryn
Administrator
in a local game (vs ai) we use some good pseudo random number generator provided by java

in a 2 player game (network game, or online game), the random dice are determined by each machine, then combined and xor'ed

both players will be able to "show verified dice" to see if the dice are different than what the host shows

in a 3+ player game (network or online) it is the same as 2 player, except that only 2 players are making the dice, while the other players are not


in a pbem/pbf game, the dice are emailed or sent over the network from a server, etc etc


the numbers generated by this are as close to random as you are going to get without a super computer.  unless you are a government trying to make a perfect encryption protocol, they are for your purposes as good as "real" random numbers

Please contribute to the TripleA 2013 donation drive:
http://tripleadev.1671093.n2.nabble.com/2013-TripleA-Donation-Drive-tp7583455.html
Reply | Threaded
Open this post in threaded view
|

Re: Dice randomness

Zim Xero
I have been noticing definite patterns in rolls coming from the chance triggers.  I realize that this is subjective and that many people claim to see patterns in basically random things, so if you dont believe this, look at several strings of results from chance triggers.  They seem to roll a lot of ones and also progress numerically up the ladder of possible dice rolls and then back to one again.
'thats the way it is' makes it neither desireable nor inevitable
Reply | Threaded
Open this post in threaded view
|

Re: Dice randomness

Veqryn
Administrator
there is an easy way to test this,

use edit mode to create a ton of strategic bombers (like 1000)

then have them all bomb a factory

(make sure there is only 1 factory there, and no interceptors, that way you don't have a dialog for who bombs what)

then run the battle and look at the results

I've looked at this before, and there is no pattern
Please contribute to the TripleA 2013 donation drive:
http://tripleadev.1671093.n2.nabble.com/2013-TripleA-Donation-Drive-tp7583455.html
Reply | Threaded
Open this post in threaded view
|

Re: Dice randomness

VictorInThePacific
There is another way to test this. Set up a battle in the Battle Calculator for which you analyze the exact outcome. Run the BC some large (or variable) number of times. Compare the dice outcome with the theoretical one.

I did at one point see some anomalies, posted in the forum about it, was questioned, went back to recheck (and fix a few errors on my part), and since that time, have seen essentially exact matches between dice results and theoretical ones, provided the number of trials is large enough.
Reply | Threaded
Open this post in threaded view
|

Re: Dice randomness

Dice Dice Baby
I have seen something that does make me question either the randomness of the dice, or at least the coding around it in certain situations. Again, as others have stated - it could just be finding patterns that aren't there but the two scenarios that seem common:

1 - Tech rolls. In testing, it seems like if you select say, 3 dice - and just roll the same dice turn after turn, it seldom if ever hits. However if I buy a dice or two, and then on subsequent turns, purchase an extra dice role (bringing total to say 2 or 3) it frequently hits when adding an additional dice. I haven't tested in large numbers, but my observation in limited testing favors rolling less and then buying to trigger a tech roll win (Vs starting off with a higher number, and rolling unchanged

2 - This one seems to pop up more frequently, but an opening attack roll where the attack hits on no dice (no kills), seems to often have the defender roll no hits frequently on that defend role. Even in large battles, this one seems to happen. Normally it is the opening roll if it happens.

I know it sounds a little tin foil hat-ty, but a friend that I play with also has observed similar behavior. Could just be a weird fluky thing, but it stands out enough to be of interest to me.

Anybody else observed something similar? Currently running with version 1_8_0_9
Reply | Threaded
Open this post in threaded view
|

Re: Dice randomness

m3tan
The deviation from true random number generation for a computer is exponentially small. The computer is much more random than actual dice. Unless you own casino dice, board game dice are anything BUT random due to terrible center of gravity...
Reply | Threaded
Open this post in threaded view
|

Re: Dice randomness

Cernel
In reply to this post by Dice Dice Baby
It is very easy to test this, albeit time consuming.

You take a bunch of savegames and put all dice rolled one after the other.

Then you see the total number of 6 rolled.
Then you see the total number of 6 rolled after another 6.
Then you see the total number of 6 rolled after a 5.
...
Then you see the total number of 6 rolled after a 1.

If the numbers of those 6 rolled are all about the same, then it likely means the probability of rolling a 6 is the same, no matter what was rolled before. If not, then there may be a pattern (or maybe it was just an accident)

Then you repeat the same for any results.

As always, this would prove nothing, as with random numbers you never know. It is theorically possible to roll nothing but 1 for a whole game, and that would not necessarily mean that dice are broken.

Have fun.
History plays dice
Reply | Threaded
Open this post in threaded view
|

Re: Dice randomness

captaincrunch
see: Chaos Theory or "order in chaos"
see: Nash Embedding Theorem or "linear equations are modular" - learned that one back in the 90's when tv still had actual educational shows

hehe ya the random number generator concept has always intrigued me and, as he mentioned, Encryption software is a big topic and I hear the properties of Prime numbers factor in.

I do like the Random Number Generator topic though it really is deep and reminds me of my old TRS80 Color computer days (Texas Instruments computer before that)
     
Reply | Threaded
Open this post in threaded view
|

Re: Dice randomness

comeninios
In reply to this post by Veqryn
Hi:

Sorry, but there are patterns. Anyone who has played a considerable number of games knows. I have some experience with the game WWII 1940 Global II Ed. I have observed at least these patterns: 1. If a major country (USA, Japan...) throws dice tech, throwing 1 dice in turn 1 and 2 dice next turn, always gets 1 success. 2. If Japan launches its 6 kamikaze attacks, always gets 2 hits. 3. The system takes into account the value of the units that are lost in battle, if one side has lost many important units or many units, just lose anything in the following battles. 4. The system punishes the side that assumes statistical risks in battle (below 75%). 5. The system tends to compensate battles and casualties. Compensates from one battle to another and from one turn to next turn. 6.- The system is not given as random, but battle to battle, choose battles where hit, generating these results even almost impossible, sometimes in several successive battles. Sorry, but whenever I feel there is a game player 1, player 2 and player 3 which is the set of dice that is intervening in the game and not truly haphazardly. Sometimes I have the feeling that they are cheating me. I'm sorry but I hate this craps system is not truly random. I would like a truly random system given.

Sorry about my english.
Reply | Threaded
Open this post in threaded view
|

Re: Dice randomness

captaincrunch
do you have Low Luck dice on?

If you do then its automatic success on a percent whereas if Low Luck dice is off you could possibly never roll what you need to hit
Reply | Threaded
Open this post in threaded view
|

Re: Dice randomness

Cernel
In reply to this post by comeninios
If you are so concerned about fearing patterns, you can play a long game of some maps rolling like 1,000 dice; then you take the savegame and do the below thing for the dice rolled, to see if there are really weird patterns or it is just your immagination:

(as I said, it is very easy to test this, just time consuming)

You put all dice rolled one after the other.

Then you see the total number of 6 rolled.
Then you see the total number of 6 rolled after another 6.
Then you see the total number of 6 rolled after a 5.
...
Then you see the total number of 6 rolled after a 1.

If the numbers of those 6 rolled are all about the same, then it likely means the probability of rolling a 6 is the same, no matter what was rolled before. If not, then there may be a pattern (or maybe it was just an accident of that savegame only)

Then you repeat the same for any results.

Then you post your results with the related savegame, showing the patterns you found.

As always, this would prove nothing, as with random numbers you never know. It is theorically possible to roll nothing but 1 for a whole game, and that would not necessarily mean that dice are broken.

Have fun.
History plays dice
Reply | Threaded
Open this post in threaded view
|

Re: Dice randomness

Cernel
In reply to this post by comeninios
To be more clear, you have a perfect random 6 sided dice system when you have exactly 1/6 probability to have each single result, at any point, no matter what was rolled before.

You can test this very easily by like playing a game till you roll like 1,000 dice and see what you rolled immediately after having rolled an 1.
If, after having rolled an 1, you see that the immediate next dice rolled was 1, 2, 3, 4, 5 or 6 each in 1/6 cases each, then there is no pattern after having rolled an 1.

Then, you do the same for 2 and 3 and 4 and 5 and 6 (actually, you can skip one of them).

If you find no pattern for any, then it means that there is no pattern at all, because the dice you are rolling at any moment is totally not influenced by anything you rolled before, and you just have 1/6 each of getting one of the 6 possible results, at any point.

And for sure in a 6 sided dice game each result has exactly 1/6 probability, on the long term, as you can very easily verify by running a long game with all AI and then looking at Game/Show Dice Stats.
History plays dice
Reply | Threaded
Open this post in threaded view
|

Re: Dice randomness

Zim Xero
I am a math and logic guy, but I know nothing about how random number generation works for the game.  I do know that everything is a pattern and contains patterns... it is unavoidable.  I also notice patterns when playing, specifically rolls of 1 tend to come in clumps.  I am not saying that the generator is bad or broken, only that I notice patterns.  
'thats the way it is' makes it neither desireable nor inevitable
Reply | Threaded
Open this post in threaded view
|

Re: Dice randomness

Cernel
Well, again, this is very easy to verify (of course, with random numbers you can never be sure).

Just play a game in which you roll 1,000 dice or just do a bombing raid with 1,000 bomber or make a tech development with 1,000 tokens.

Then take a savegame and take all the dice that you rolled immediately after having rolled a 1.

If all these dice have about exactly 1/6 of 1, 2, 3, 4, 5 and 6 each, then for sure there is no pattern for the 1.

Because, even if it would exist a pattern for anything else, the fact that you have 1/6 of anything after having rolled a 1 would nullify it, since (as you can verify by running a very long AI game and looking at Game/Show Dice Stats) the average results in the long run are about perfectly 1/6 for each number.
History plays dice
Reply | Threaded
Open this post in threaded view
|

Re: Dice randomness

Cernel
In reply to this post by Zim Xero
Zim Xero wrote
rolls of 1 tend to come in clumps.
The clumps question: If I roll six dice, will the 1 concentrate in a bunch of rolls with abnormal frequency? Do the 1 all come together in bunches? Do I see a lot of 1 all together, and then I don't see 1 anymore for a while?

It's a legitimate question, and there can be legitimate answers.

To verify that dice results come or not in clumps is even easier, as you can do it with the battlecalculator, that it is a battlesimulator.

If you, for example, think that when rolling six dice, one after the other, there is a higher probability than normal of rolling three or more 1 at the same time (abnormal frequency of having half or more out of six dice being 1), then you can make 6 infantry attacking 3 infantry for only 1 combat round and see how frequently they win combat right in the first combat round.

For the theory, you can use the "binomial distribution":
http://en.wikipedia.org/wiki/Binomial_distribution
that says that the probability of rolling K times 1 with six rolls of six-sided dice is:
k=3 : 0.053584
k=4 : 0.008038
k=5 : 0.000643
k=6 : 0.000021
total = 0.062286

(been a while, hopefully I haven't made mistakes, feel free to double check, thanks!)

So, the probability of rolling three or more 1 out of six dice is little more than 6%.

Then, you can use the battlecalculator and make 6 infantry attack 3 infantry per 1 round of combat, and (to me, at least) it tells you is 6% win.

So, from this BATTLECALCULATOR tests, it seems that having three or more 1 out of six dice happens about exactly as frequently as it should.

And, yes, if, when you roll a bunch of like six dice, you see like three or more of these being 1 happening with a frequency of about 6%, that's very normal.

If you don't want to use the battlecalculator, feel free to do the above test by editing a battle of 6 infantry vs 3 infantry for 1,000 times. You should win on the first combat round about 6 times every 100. Myself, not going to.

If the "clump" of six dice is not the right one, we can redo with whatever number of dice and whatever quantity of 1 rolled in it (only limit is that we can't go too low on probabilities, because the TA battlecalculator rounds everything to 1% (for example, the probability of rolling five 1 out of six dice is just given as 0%)).
History plays dice
Reply | Threaded
Open this post in threaded view
|

Re: Dice randomness

captaincrunch
This post was updated on .
@comeninios and Xim Zero, unfortunately too often there's a forgotten edict to science that "Correlation DOES NOT MEAN causation" and your observations brings to mind Benford's Law;

http://phys.org/news/2007-05-law-digits-scientists.html

Like look at these examples of completely random patterns ... there's an infinite amount of these patterns!;

https://en.wikipedia.org/wiki/Smith_number

http://www.damninteresting.com/the-birthday-paradox/

https://www.reddit.com/r/math/comments/2479nb/berry_paradox_the_first_number_that_cant_be/


My point is a pattern can be found and we can name it but does it have any value like did we influence that patterns existence through complete randomness? Yes!


Basically, the astrology people are whackjobs but anyways  you may think you see patterns in a set of random events/numbers but proving there is a pattern is the question. Deductive > Inductive.


This always reinforces my belief in a random unknowable unpredictable god very much like the value of Q ... the Unknown Value/Quantity; http://jeff560.tripod.com/variables.html

"Michael Stifel used q (abbreviation for quantita (which Cardan had already done) but he also used A, B, C, D, and F, for unknowns in 1544 in Arithmetica integra (Cajori vol. 1, page 140)."

  because life truly is free-willed and one unique moment to every single one of us in time and Star Trek fans might find it a coincidence that there is a God-like character on Star Trek named Q (rip) but apparently his name was by chance but still interesting but anyways don't let those patterns fool ya.

(anyone ever gonna expand on how a computer generates a random number? I hear theres many ways but hoped someone would explain one)