Random number generators

Resolute

Chieftain
Joined
Dec 6, 2003
Messages
6
Location
Reading, UK
Is there any evidence that the RNG is broken (or otherwise) in this game, beyond the anecdotal? I'm always left with the strong impression that, while for large numbers of random numbers the RNG produces the right distributions (e.g. swordsman kills spearman on hills 50% of the time), there is a high correlation between one random event and the next in a combat. Is this the case? Are individual hit points worth of attacks calculated seperately, or is the whole combat result predetermined in one 'dice roll' and the hit points removed in the most dramatic manner?(!) I've seen people claim that the RNG is streaky and I am interested to know if this is generally accepted. From what I've read on the subject, even the most basic form of RNG shouldn't show the streaks of the kind I keep thinking I see...

Resolute
(who's still trying to beat C3C on Monarch as England. Even though his girlfriend has taken to describing herself as a 'civ widow')
 
There is no statistical evidence that the RNG is broken and quite a bit that shows that it is a fairly standard linear congruential style RNG.

BTW, if you never had streaks, that would be a sign of a bad RNG. Streaks do happen in random sets of data.
 
I've seen lots of offhand comments to the effect that the RNG is "streaky." I've noticed it seems this way as well. I always assumed there was some kind of experiment done which showed it to be streaky, and that's why people could so casually make the claim.

But there has not been such an experiment?

How do you measure streakiness in an otherwise random set of data?

-mS
 
Originally posted by Master Shake
I've seen lots of offhand comments to the effect that the RNG is "streaky." I've noticed it seems this way as well. I always assumed there was some kind of experiment done which showed it to be streaky, and that's why people could so casually make the claim.

But there has not been such an experiment?

How do you measure streakiness in an otherwise random set of data?

-mS

Experiments have been done. But they show that the RNG is perfectly fine.

Statistical tests of combat, show that the expected results do occur (I along with others have personally done these). Additionally another poster was able to gain access to the base RNG for vanilla Civ3 by hacking and ran the RNG through an industry standard test suite to validate its functionality. The civ3 RNG passed, showing the correct distributions and streakiness.

As Warpstorm pointed out the absence of streaks would be indicative of a faulty RNG. As an interesting fact, the human mind is very bad with randomness. When asked to generate a random list of number or coin tosses, the list we generate does not approximate a natural random list very well at all. In particular it will be too "random," lacking the natural amount of streakiness.
 
Is there anywhere on the net I can do some research as to what is an appropriate amount of "streakiness" in cases like this?

-mS
 
Originally posted by Master Shake
Is there anywhere on the net I can do some research as to what is an appropriate amount of "streakiness" in cases like this?

-mS

Don't know of any good sources off hand. But I can give you a quick explanation of what is appropriate. Lets take a binary case (like flipping a coin) where each possibility has a 50-50 probability of happening.

For any given flip there is a 50% chance of the coin coming up heads. And in the course of say 1000 throws, there will be roughly 500 heads.

Now the probability of getting two heads in a row is 50%*50%=25%. So in the course of 1000 throws you would expect there to be 250 times in which the coin came up heads twice in a row. And which is half of the time in which the coin came up heads.

Now the probability for getting 4 heads in a row is 50%^4=6.25%, or that there should be roughly 6 sets of 4 heads in a row in those thousand throws.

In a game of Civ, you will have far more than 1000 "coin throws" and as such the even less likeir occurances will occur. And there population will match there probability of occurance.

Of course the game is more complex than the 50-50 example above, but that just changes the math. The game also generates a number out of a large range of possible values, and as such the statistical validation of those numbers is a bit more complex. But when you look at the precision that is used by the game, it is reduced to the above explanation.

Additionally it is hard to make judgements as to the quality of the randomness with a small sample size. The distribution becomes more refined, and approaches it theoretical value more closely the larger the sample size becomes. Ie if you flip a coin 20 times and it comes up heads 10 times in a row, is the coin weighted, or did you just see a normal occurance that should happen roughtly ten times in 10,000 flips?
 
Back
Top Bottom