The dice: an experiment

Talk about all things related to Conquer Club

Moderator: Community Team

Forum rules
Please read the community guidelines before posting.
MrsMad
Posts: 11
Joined: Tue May 02, 2006 1:12 pm

The dice: an experiment

Post by MrsMad »

I decided, as I wanted to whoop ass at this game, to find out the exact chances of winning/losing armies when attacking. (ie so u know the best strategy - whether it's best to sit there building up armies or attack at every opportunity etc.). I'm a computer programmer, so I wrote a program whuich went through every combination of dice rolls to work out the statistics. Here's the results...

#(attacker) v (defender)
#3 dice v 2 dice
#2 off defender = 37%
#2 off attacker = 29%
#1 off each = 34%

#2 v 2
#2 off defender = 23%
#2 off attacker = 45%
#1 off each = 32%

#1 v 2
#1 off defender = 25%
#1 off attacker = 75%

#3 v 1
#1 off defender = 66%
#1 off attacker = 34%

At least, thats how it's SUPPOSED to be!

So, here's the thing...

I know that the dice are from random.org, but they appear incredibly biased towards the defender. There is NO WAY that when you attack with 3 dice versus 2, you only lose 2 armies only 29% of the time.

And there's no way that when attacking with 3 v 1 that you win 66% of the time.

Add a bit of code to the program which colllects the statistics on dice rolls (ie simular to the above). This would be very simple to do. Then post the percentages at the end of the month.

I am happy to retreat back into my cave if I am proved to be wrong :-)

MrsMad

ps. I know the random numbers are from random.org, but with an online game with tousdands of players based largely on the luck of the dice, it important to verify that it's accurate and truly random?
User avatar
lackattack
Posts: 6097
Joined: Sun Jan 01, 2006 10:34 pm
Location: Montreal, QC

Post by lackattack »

If you want to test the numbers you can write a greasemonkey script of sorts that will plug into your browser. Have it log the results and you can compare the probabilities to what you have calculated above.

I won't write the script because I'm confident the dice are random and my time is better spent on inproving the game.
User avatar
KoolBak
Posts: 7414
Joined: Fri Feb 03, 2006 1:03 pm
Gender: Male
Location: The beautiful Pacific Northwest

Post by KoolBak »

Wow...MrsMad does more than just kick my ass.......coool!
"Gypsy told my fortune...she said that nothin showed...."

Neil Young....Like An Inca

AND:
riskllama wrote:Koolbak wins this thread.
MrsMad
Posts: 11
Joined: Tue May 02, 2006 1:12 pm

Post by MrsMad »

lackattack wrote:If you want to test the numbers you can write a greasemonkey script of sorts that will plug into your browser. Have it log the results and you can compare the probabilities to what you have calculated above.


Fair play. I'll have a bash at it.
User avatar
Tr0y
Posts: 271
Joined: Mon Jan 23, 2006 1:26 pm
Location: Cary, NC
Contact:

Post by Tr0y »

A simple Greasemonkey script will not work because dice results are not present in the log. And even if they were... it would take a bunch ( 1000s ) of dice rolls to fairly determine if the dice are bias.

I remember reading that the dice file looks something like this...

D# D# A# A# A#
D# D# A# A# A#
D# D# A# A# A#

Where the # is the number on the dice.

A better random file would be...

# # # # # # # # # # # # #.... and so on.

The way the dice file is setup now is random, however a bias is easier to spot because they are separated into 'battles' ... If you just load the file with #s ... all people can say is there are more x's than y's ... but that is randomness for you.

Then attacker/defender bias becomes a less of an issue ( if an issue at all )...

Other things you can do to make the dice "more fair" would be measuring the distribution of each # and the frequency of them.
Keep generating #s till you get a set that most closely represents the expected values.

Of course unlikely things are going to happen. For example, rolling three 6s... But if you took a quarter an flipped it a 100 times, I'm pretty sure you will flip 8 heads/tails in a row.

If you want me to run tests to verify the "randomness" of the #s I can.
User avatar
Jota
Posts: 634
Joined: Wed Mar 29, 2006 7:38 pm

Post by Jota »

So Greasemonkey has no way to save persistent data across pageviews?
User avatar
Pilate
Posts: 382
Joined: Thu May 18, 2006 10:21 pm
Location: Toronto, Canada

Post by Pilate »

The dice are not purely random in a statistical sense.

There is a 3.6 % chance (36 in 1000) of losing 3 "3 vs 1" rolls in a row. This is significantly slower than the actual chances in CC.
User avatar
wacicha
Posts: 3988
Joined: Fri Jan 27, 2006 6:51 pm
Gender: Male
Contact:

Post by wacicha »

dang Pilate you can do that kind of thinking and still kick my butt. good job
Image
User avatar
Jota
Posts: 634
Joined: Wed Mar 29, 2006 7:38 pm

Post by Jota »

So you've finished doing a full statistical analysis of all die roll results over an extended period of time already, Pilate? Could you please publish your raw data and collection methods so that we can all confirm your conclusions?
User avatar
Mr.Catfish
Posts: 6
Joined: Thu Jun 22, 2006 4:58 pm

Post by Mr.Catfish »

"Never tell me the odds"; lol star wars
User avatar
Tr0y
Posts: 271
Joined: Mon Jan 23, 2006 1:26 pm
Location: Cary, NC
Contact:

Post by Tr0y »

Well I was first going to respond... "It is not worth it"

But...

Then I started thinking about all those people who believe the dice are bad.

And I thought it would be funny to have a luck stat somewhere.... And maybe even a distribution of rolls as attacker.

e.g.
[ Wins x% | Losses x% ]

Rolls
1s [ # (#%) ]
2s [ # (#%) ]
3s [ # (#%) ]
4s [ # (#%) ]
5s [ # (#%) ]
6s [ # (#%) ]

So yea... I think I can do it... Dont know if I will or not... more of a fun stat...
MrsMad
Posts: 11
Joined: Tue May 02, 2006 1:12 pm

Post by MrsMad »

Currently working on it ;-)

Image
User avatar
Tr0y
Posts: 271
Joined: Mon Jan 23, 2006 1:26 pm
Location: Cary, NC
Contact:

Post by Tr0y »

Sonava :shock:

*clicks close on photoshop... clicks no when asked to save luck gradient... [sigh]*

Looks like I have some competition.

Very well done :wink:

Did you use gm_getValue/gm_setValue to save data?
MrsMad
Posts: 11
Joined: Tue May 02, 2006 1:12 pm

Post by MrsMad »

lol *friendly competition*

I'll be taking the 'attacker rolls xxx defender rolls xx ' line and extracting the data from that then using those gm_getvalue and gm_setvalue. What u see there is just the html at the mo.

I'm thinking, it shouldnt be too difficult to create 2 different views. One for the current game and one for all the games u've played - each games data could be stored in a single setvalue string. Would be interesting just to see how lucky/unlucky u've been each game.
User avatar
Pilate
Posts: 382
Joined: Thu May 18, 2006 10:21 pm
Location: Toronto, Canada

Post by Pilate »

Jota wrote:So you've finished doing a full statistical analysis of all die roll results over an extended period of time already, Pilate? Could you please publish your raw data and collection methods so that we can all confirm your conclusions?

I remember someone saying that the nice are not fully random, but they are as random as they can get.

For, 3 v 1 rolls. If you have 6 v1 and you attack up to three times (6v1, 5v1, 4v1) you should expect to NOT GAIN the territory one out of every 27.7 tries. I think the true value is significantly less than 27.7.

Actually, anyone can do a simple analysis.

Look at all the times you go three dice vs 1. You should expect to win 2 territories for every troop you lose. Make note of all the times that your success - troop lost ratio EXCEEDS 2. You'll notice that this happens very seldomly.

It's not random, but at least it's consistently not random. That's why i'm fine with the dice.
User avatar
Pilate
Posts: 382
Joined: Thu May 18, 2006 10:21 pm
Location: Toronto, Canada

Post by Pilate »

wacicha wrote:dang Pilate you can do that kind of thinking and still kick my butt. good job


lololo, 9 years of schooling pays off.

I think I'm going to learn the math all over again when i go to teacher's college too.
User avatar
joeyjordison
Posts: 1170
Joined: Wed Apr 19, 2006 9:10 am

Post by joeyjordison »

hey. still doin GCSE maths so i'm a long way behind u guys but i hav had a go at determining the likeliness of each dice combination using the method where u write the possible outcomes eg 1-6 and then the possible outcomes after those. so with 3 dice there are 3 columns looking something like this.

1-1
-2
-3
-4
-5
-6

only there is a third column and it is done for all the combinations. i then put in the fractions so 1/6 chance for each dice roll. my results showed pretty much the same as urs leading to the conclusion that the dice are biased to the defender.

please correct me if i hav gone wrong somewhere.
User avatar
Jota
Posts: 634
Joined: Wed Mar 29, 2006 7:38 pm

Post by Jota »

Pilate wrote:Actually, anyone can do a simple analysis.
Look at all the times you go three dice vs 1.


Yes, please do this. Until you have actually done it, using statistically consistent methods, you have no justification for making any claims about the dice either way.
User avatar
qeee1
Posts: 2904
Joined: Sun Feb 05, 2006 12:43 pm
Location: Ireland

Post by qeee1 »

Joey... that post made no sense to me.

And I think you can make claims about the dice, without doing analysis, but should preface them by saying, "it seems to me" or something of the sort.

Anyway look forward to the results.
Frigidus wrote:but now that it's become relatively popular it's suffered the usual downturn in coolness.
User avatar
Pilate
Posts: 382
Joined: Thu May 18, 2006 10:21 pm
Location: Toronto, Canada

Post by Pilate »

Jota wrote:
Pilate wrote:Actually, anyone can do a simple analysis.
Look at all the times you go three dice vs 1.


Yes, please do this. Until you have actually done it, using statistically consistent methods, you have no justification for making any claims about the dice either way.


have you ever heard of gregor mendel? If he used your methods, we might not know about genes and alleles
Pedronicus
Posts: 2080
Joined: Tue Jan 24, 2006 2:42 pm
Gender: Male
Location: Busy not shitting you....

Post by Pedronicus »

How long before enough data has been gathered to obtain a good gauge of dice?
User avatar
Jota
Posts: 634
Joined: Wed Mar 29, 2006 7:38 pm

Post by Jota »

A few hundred rolls, maybe? There are formulas that will let you calculate your confidence level based on how many data you've accumulated, but I don't remember any of them off the top of my head.
User avatar
Pilate
Posts: 382
Joined: Thu May 18, 2006 10:21 pm
Location: Toronto, Canada

Post by Pilate »

no, a sample size of about 50 is definitely enough. i'm too lazy to check my stats textbook right now
User avatar
AndyDufresne
Posts: 24935
Joined: Fri Mar 03, 2006 8:22 pm
Location: A Banana Palm in Zihuatanejo
Contact:

Post by AndyDufresne »

I'd go for more than 50. More people would be willing to believe the results if there was a large test field.


--Andy
MrsMad
Posts: 11
Joined: Tue May 02, 2006 1:12 pm

Post by MrsMad »

I would imagine more like 1000 dice. But it's a guess.

luck analyzer coming soon.....

Image
Post Reply

Return to “Conquer Club Discussion”