Verified:

SolidSnake Game profile

Member
867

Oct 28th 2010, 0:06:47

a couple of the game formulas seem out of whack, particularly although perhaps not exlusively

missiles/sdi

recently i took 62 nuke missiles to my country maintaining 85% or more sdi throughout, 22 succeeded. The improbability of that occuring i can only assume that something relating to the formula of probabilities is off quite substantially

is this a known difference, or am i supposedly just increadibly unlucky?

Devestation Game profile

Member
812

Oct 28th 2010, 3:50:32

You're incredibly unlucky that so many got through. You're incredibly lucky that SOL would pick someone with 85% SDI as their nuke target.

Ozzite Game profile

Member
2122

Oct 28th 2010, 4:54:48

Assuming your SDI was at 85% the whole time for simplicity, what we have is a Bernoulli process with n=62 trials and p=.15 as the success rate. The probability for this is governed by the binomial distribution. The probability of there being exactly 22 successes in 62 trials is 5.2649E-4 %, and the probability of there being 22 or MORE successes in 62 trials is 6.4481E-4 %.

So yeah, you got screwed or there is something else at play.

N.B.: I used the normal approximation to the binomial distribution, i.e. N(np,np(1-p)), so the numbers may be *slightly* off
Ah, mercury. Sweetest of the transition metals.

locket Game profile

Member
6176

Oct 28th 2010, 6:48:14

this happned with another guy in laf i saw. A shorter term amount of missiles though...

qzjul Game profile

Administrator
Game Development
10,263

Oct 28th 2010, 19:00:47

i'm pretty sure we've tested them fairly thoroughly
Finally did the signature thing.

Thomas Game profile

Member
1763

Oct 28th 2010, 22:41:15

I bet if you nuked qzjul's country and saw how many were actually defended this fluff would get fixed like pronto. So do it! ;) ;)

qzjul Game profile

Administrator
Game Development
10,263

Oct 29th 2010, 0:15:48

hmn but i have 0 SDI points so i wouldn't really notice...
Finally did the signature thing.

NOW3P Game profile

Member
6503

Oct 29th 2010, 1:08:09

Keep in mind that as you get hit with more missiles, your SDI drops. So you not only have what Ozz described above, but you also incrementally increase the likelihood of a missile passing your SDI every time one does not (i.e. those 44 that hit your SDI)

Just because you have %85 SDI does not mean you're going to block %85 of the missiles fired at you. It just means you have a %85 chance of blocking every missile. If the first bounces and takes %1 of your SDI away, you will then have an %84 chance of blocking the next, %83 of blocking the next, %82, etc etc, etc.

44 missiles will decrease your SDI by appx %20-%25 or so if I remember correctly.

But yeah, it's just some bad luck too.

Ozzite Game profile

Member
2122

Oct 29th 2010, 2:37:03

l3arn to r3ad NOW3P :-P

"i took 62 nuke missiles to my country maintaining 85% or more sdi throughout"

THROUGHOUT

whether that is true, I do not know, but that is what he claimed :-P If anything the probability of it happening is lower than my numbers
Ah, mercury. Sweetest of the transition metals.

snawdog Game profile

Member
2413

Oct 29th 2010, 2:52:31

Yea, SDI is fubar'd in ffa as well, i have 80% plus on my attacked countries,and at LEAST 1 of 3 get thru...the formula is skeeked BAD..
ICQ 364553524
msn






Marshal Game profile

Member
32,589

Oct 29th 2010, 19:18:12

your sdi has 80% chance to stop those missiles so .......... prolly just bad luck.
Patience: Yep, I'm with ELK and Marshal.

ELKronos: Patty is more hairy.

Gallery: K at least I am to my expectations now.

LadyGrizz boobies is fine

NOW3P: Morwen is a much harsher mistress than boredom....

NOW3P Game profile

Member
6503

Oct 30th 2010, 4:34:32

I expanded on the thought to help him understand the point, Ozz.

SDI seems to be exactly the same as before - sometimes it'll stop 10:10, sometimes it'll stop 6:10 - all depends on random luck though.

Ozzite Game profile

Member
2122

Oct 30th 2010, 7:38:04

Originally posted by NOW3P:
I expanded on the thought to help him understand the point, Ozz.

SDI seems to be exactly the same as before - sometimes it'll stop 10:10, sometimes it'll stop 6:10 - all depends on random luck though.


I understand that, in fact I provided the probabilities of the occurrenes of such things and how to calculate them :-P
Ah, mercury. Sweetest of the transition metals.

Slagpit Game profile

Administrator
Game Development
4622

Oct 30th 2010, 23:02:04

Our own internal review concluded that the only issue would be with the random number generator. If any statistically minded people want data to test it, I would be happy to provide it.

Ozzite Game profile

Member
2122

Oct 30th 2010, 23:42:10

Originally posted by Slagpit:
Our own internal review concluded that the only issue would be with the random number generator. If any statistically minded people want data to test it, I would be happy to provide it.


I would be happy to confirm that your random number generator is working if you provide me with a sizable set of samples, but the best solution would be to post the relevant code.

It is very hard to believe that this could be caused by a bad random number generator. If people consistently think this is happening my guess is it is bad code.

For the record, I am not necessarily saying there is ANY problem. Things much more unlikely than 5.2649E-4 % happen every day.
Ah, mercury. Sweetest of the transition metals.

qzjul Game profile

Administrator
Game Development
10,263

Oct 31st 2010, 18:00:31

return (mt_rand()/mt_getrandmax());

is all it is =/

where those functions are here:

http://ca3.php.net/...l/en/function.mt-rand.php
Finally did the signature thing.

deepcode Game profile

Member
309

Nov 1st 2010, 5:17:02

Shouldn't there be some code to seed the generator somewhere? to stop repeat sequences from cropping up.

Pang Game profile

Administrator
Game Development
5731

Nov 1st 2010, 5:25:47

I haven't tested this as thoroughly as qz and slag have, but I'm inclined to agree with them. I've looked at the formula, and short of the random number generator not being random, the math looks solid.

but this is probably the most common formula "bug" that gets brought to my attention. and not just by SS. :p

we could potentially run some more thorough analytics, but that would have to come down the line
-=Pang=-
Earth Empires Staff
pangaea [at] earthempires [dot] com

Boxcar - Earth Empires Clan & Alliance Hosting
http://www.boxcarhosting.com

Fooglmog Game profile

Member
1149

Nov 1st 2010, 5:39:36

Originally posted by Slagpit:
Our own internal review concluded that the only issue would be with the random number generator. If any statistically minded people want data to test it, I would be happy to provide it.


Are we talking a record of missile success rates with SDI percentages, or just a statistical breakdown of the random number generator itself?

-Fooglmog
Guy with no clue.

Fooglmog Game profile

Member
1149

Nov 1st 2010, 6:17:50

Wait a second... why are you using mt_getrandmax() in your "return (mt_rand()/mt_getrandmax());" statement?

Isn't that consistently going to give you a return with incredibly small exponents? Don't you just want to do "return (mt_rand(1, 100)/100);"?

I set up a test page at http://inklined.net/test/. It's just a sample of 20 mt_rand(1, 100)/mt_getrandmax() returns. To be fair, it's all just random number, and I don't know how the random number influence your formula but I can't imagine why you'd want exponents in the E-8 or larger range.

EDIT: I made an error above, I forgot that the arguments added to mt_rand() were mine... that page no longer shows what I said it does.

-Fooglmog
Guy with no clue.

Edited By: Fooglmog on Nov 1st 2010, 6:44:57
See Original Post

Slagpit Game profile

Administrator
Game Development
4622

Nov 1st 2010, 6:27:32

The code for checking success or failure is laughably simple, but I just made a table to log certain data for further testing. We love you guys that much!

mt_rand() belongs to the integers in [0, mt_getrandmax()]

therefore, mt_rand()/mt_getrandmax() belongs to [0,1]

(mt_rand(1, 100)/100) isn't quite what we want because SDI defense is more finely grained than integers.

Edited By: Slagpit on Nov 1st 2010, 6:40:55
See Original Post

Fooglmog Game profile

Member
1149

Nov 1st 2010, 6:43:45

Ah, stupid mistake from me. Sorry. I added the arguments to mt_rand() when I was playing with the code and forgot they were my addition instead of exactly what qz had posted.

Could you still post the section of code dealing with missile success? I'd like to see it in its entirety if I could.

-Fooglmog
Guy with no clue.

Ozzite Game profile

Member
2122

Nov 2nd 2010, 0:55:33

So the code you provided for sampling a number in [0,1] in php is fine as long as you call mt_srand() before you call it, otherwise you are always getting the same sequence of random numbers.

I assume the rest of the code looks like:

isMIssileBlocked() {
SDI = getSDI%()
randNum = getRand(0,1)*100
if((1.0 - SDI) > randNum)
return true
else
return false
}

?
Ah, mercury. Sweetest of the transition metals.

Ozzite Game profile

Member
2122

Nov 2nd 2010, 0:56:00

this centering is bullfluff for the record....
Ah, mercury. Sweetest of the transition metals.

Fooglmog Game profile

Member
1149

Nov 2nd 2010, 1:04:51

They don't need mt_srand()... mr_rand() uses a random seed by default... in effect, the seed is random unless you use mt_srand() with arguments.

And making up code isn't really helpful... if we're going to confirm that the code works, we need to see what it is, not make up what it could be.

-Fooglmog
Guy with no clue.

Ozzite Game profile

Member
2122

Nov 2nd 2010, 1:14:40

http://php.net/.../en/function.mt-srand.php


Note: As of PHP 4.2.0, there is no need to seed the random number generator with srand() or mt_srand() as this is now done automatically.


whoops :-P


Originally posted by Fooglmog:
and making up code isn't really helpful... if we're going to confirm that the code works, we need to see what it is, not make up what it could be.



suck mah balls
Ah, mercury. Sweetest of the transition metals.

Slagpit Game profile

Administrator
Game Development
4622

Nov 2nd 2010, 1:54:12

Tertius Game profile

Member
EE Patron
1487

Nov 2nd 2010, 2:51:24

If someone has access to minitab or something like that, it would be really easy to look through those statistics.

martian Game profile

Game Moderator
Mod Boss
7828

Nov 12th 2010, 2:03:43

I've tested the rng extensively for "randomness" (lack of pattern) and distribution and it is fine for purposes of this game. (Good enough to test at least 1 in 500 events which is beyond the scope of this game).

"Assuming your SDI was at 85% the whole time for simplicity". There's your problem. in fact it drops faster than you think it does and that greatly throw's off your test I think.

your normal approx actually understates the probability somewhat but at n=65 it's shouldn't have that great of an impact.
you are all special in the eyes of fluff
(|(|
( ._.) -----)-->
(_(' )(' )

RUN IT IS A KILLER BUNNY!!!

Ozzite Game profile

Member
2122

Nov 12th 2010, 3:15:22

Originally posted by martian:
I've tested the rng extensively for "randomness" (lack of pattern) and distribution and it is fine for purposes of this game. (Good enough to test at least 1 in 500 events which is beyond the scope of this game).

"Assuming your SDI was at 85% the whole time for simplicity". There's your problem. in fact it drops faster than you think it does and that greatly throw's off your test I think.

your normal approx actually understates the probability somewhat but at n=65 it's shouldn't have that great of an impact.


First of all I tested the numbers myself and got similar results, but my estimate is not incorrect. SS claims that his SDI stayed above 85% THE ENTIRE TIME. Whether or not that is true I cannot say, but that is what he said.

=P
Ah, mercury. Sweetest of the transition metals.

Tin Man

Member
1314

Nov 12th 2010, 4:04:48

wouldn't it have to do with the % of land the nuke takes away if successful and wouldn't that raise SDI?

martian Game profile

Game Moderator
Mod Boss
7828

Nov 12th 2010, 13:36:36

"SS claims that his SDI stayed above 85%".
missed that.
Well if that is true than your argument is correct.

It's entirely possible that the issue isn't the formula testing missile success + rng but something relating to the SDI% as displayed vs what is actually being used.

Just a random thought
you are all special in the eyes of fluff
(|(|
( ._.) -----)-->
(_(' )(' )

RUN IT IS A KILLER BUNNY!!!

qzjul Game profile

Administrator
Game Development
10,263

Nov 12th 2010, 18:28:35

SDI display percentage uses the exact same formula as the SDI calculated percentage; there is no problem there.

I suspect the "SS claims that his SDI stayed above 85%". is incorrect.

Either that or he's just unlucky ;)

Technically speaking somebody with 98% SDI could be missile killed without a single defend.... though it's unlikely ;)
Finally did the signature thing.

Slagpit Game profile

Administrator
Game Development
4622

Nov 13th 2010, 2:08:03

8269 data points so far... I assume that nobody did anything with it?

Fooglmog Game profile

Member
1149

Nov 13th 2010, 6:25:09

I've done some Slagpit, it all works out as far as I can see. Here's how the numbers break down with 8360 data points.

Average SDI: 0.34536566
Overall Success Rate: 0.65450413
Variance: 0.00013021
Average Random Variable: 0.50094538

As for random variable distribution, it is as follows:
Expected: 836
0.0-0.1: 832 Variance: -4
0.1-0.2: 834 Variance: -2
0.2-0.3: 837 Variance: +1
0.3-0.4: 843 Variance: +7
0.4-0.5: 793 Variance: -43
0.5-0.6: 871 Variance: +35
0.6-0.7: 809 Variance: -27
0.7-0.8: 853 Variance: +17
0.8-0.9: 852 Variance: +16
0.9-1.0: 836 Variance: 0

As you can see, the largest variance from the expected takes place between 0.4 and 0.5... a variance of 5.14%. This is high, but not unreasonably so given the sample size.

I also did a breakdown in 500 hit increments, to make sure that there weren't time-based statistical anomalies. Obviously smaller sample sizes mean greater error rates, however, there was never more than a 3.5% difference between bounce rates predicted bounce rates based on SDI. The random variable never deviated more then 3.5% from the expected 0.5 average either.

In other words, as far as I can tell, everything checks out.

-Fooglmog
Guy with no clue.

llaar Game profile

Member
11,278

Nov 13th 2010, 18:06:28

sounds like it all checks out

nifty info

SolidSnake Game profile

Member
867

Nov 17th 2010, 0:33:19

Originally posted by qzjul:

I suspect the "SS claims that his SDI stayed above 85%". is incorrect.


qz.. all you have to do is look at my country to see considering the nm loss it would of been impossible to go bellow 82-83% even without buying sdi which i did consistantly between hits

your basic answer is that i am just unlucky to an extent that should be impossible...

qzjul Game profile

Administrator
Game Development
10,263

Nov 17th 2010, 5:32:10

Originally posted by SolidSnake:
your basic answer is that i am just unlucky to an extent that should be impossible...


I never said anything about impossible; it's more than possible
Finally did the signature thing.

Pang Game profile

Administrator
Game Development
5731

Nov 17th 2010, 5:51:04

we have mechanisms in place now that can tell us that exact type of data, so if it ever happens again, we'll be able to model it very effectively.

so let's drop the issue until then, and then look at the data next time :p
-=Pang=-
Earth Empires Staff
pangaea [at] earthempires [dot] com

Boxcar - Earth Empires Clan & Alliance Hosting
http://www.boxcarhosting.com

Marshal Game profile

Member
32,589

Nov 17th 2010, 18:56:08

Originally posted by Pang:

so let's drop the issue until then, and then look at the data next time :p


so next set. :P
Patience: Yep, I'm with ELK and Marshal.

ELKronos: Patty is more hairy.

Gallery: K at least I am to my expectations now.

LadyGrizz boobies is fine

NOW3P: Morwen is a much harsher mistress than boredom....

Ozzite Game profile

Member
2122

Nov 19th 2010, 1:39:45

bah there isn't any issue. unlikely fluff happens all the time. what are the odds that we would exist and be talking on these forums. A fluffton less than your little missile bullfluff =]
Ah, mercury. Sweetest of the transition metals.

Slagpit Game profile

Administrator
Game Development
4622

Nov 19th 2010, 2:42:35

If you won the lottery, would you conclude that there was something wrong with how they generated the winning numbers?

Fooglmog Game profile

Member
1149

Nov 19th 2010, 3:24:27

Yes. But I wouldn't tell anyone.

-Fooglmog
Guy with no clue.

qzjul Game profile

Administrator
Game Development
10,263

Nov 19th 2010, 4:50:32

Slag: I'd really question their methods for sure, as I've never actually bought a lottery ticket.


disclaimer: well I guess I was forced to contribute to a work pool once or twice, but that doesn't really count, as I was certain we'd lose that time and I'd be unlikely to see that much anyway.
Finally did the signature thing.

Marshal Game profile

Member
32,589

Nov 19th 2010, 21:15:49

at here its 1:15m chance to get jackpot on lottery.
Patience: Yep, I'm with ELK and Marshal.

ELKronos: Patty is more hairy.

Gallery: K at least I am to my expectations now.

LadyGrizz boobies is fine

NOW3P: Morwen is a much harsher mistress than boredom....

martian Game profile

Game Moderator
Mod Boss
7828

Nov 23rd 2010, 16:37:23

and remember if you live in north america your odds of dying in a car crash are roughly 1 in 15,000
:P
you are all special in the eyes of fluff
(|(|
( ._.) -----)-->
(_(' )(' )

RUN IT IS A KILLER BUNNY!!!

qzjul Game profile

Administrator
Game Development
10,263

Nov 23rd 2010, 19:14:57

so after you've died in a car crash 1000 times, then you have a good chance at winning the lottery =D
Finally did the signature thing.

qzjul Game profile

Administrator
Game Development
10,263

Nov 23rd 2010, 19:15:47

Also, I presume that's per year or something martian, not per time you drive...
Finally did the signature thing.

Marshal Game profile

Member
32,589

Nov 23rd 2010, 19:23:40

at italy its worse to get jackpot on lottery, 1:650mish so very very very small.
Patience: Yep, I'm with ELK and Marshal.

ELKronos: Patty is more hairy.

Gallery: K at least I am to my expectations now.

LadyGrizz boobies is fine

NOW3P: Morwen is a much harsher mistress than boredom....

Fooglmog Game profile

Member
1149

Nov 23rd 2010, 21:35:22

I think it's per life-time qz ;)

As in, 1 in every 15,000 people die in a car crash... rather than, each year (or worse, each time you drive) you have a 1 in 15,000 chance of dying.

Assuming that the number is correct.

-Fooglmog
Guy with no clue.