I just read something about civ3 RNG (random number generator) in another thread and I think RNG's need a bit of defending. At the same time, I'll share some of my opinions about the RNG with you. First, here's how a RNG's work (briefly, I'm not an expert).
Basically, it starts with a seed. That's a number generated (usually) by the internal clock of the computer. By using some sort of combination of the date and time (up to the millisecond), you get a number. Then, that number is fed into a function. This is the mysterious part. Essentially, this function is "chaotic". That means that it's very complicated and that, more importantly, if you start with a seed of say 0.5123, you'll get a very different number than if you had used 0.5124. The other important characteristic of this function is that you'll get something "random". I'll explain what this means below. To get the second "random" number, you feed the first one into the function and bingo, you've got what is essentially a random sequence of numbers. In Civ3, this new number is kept (if you keep the flag "keep seed" on) in the savegame. Next time you load a game, you're at the same point in the sequence.
The random in " " means basically that any sequence you'll get using this method will (using mathematical analysis) satisfy very precise mathematical conditions that a purely "theoretical" random variable would also satisfy. However, the sequence is not completely random, eventually, you can get back to your starting point. In fact, one of the properties of an RNG is how many iterations of the function will bring you back to your starting point, on average. The bigger the number, the better the RNG is. But we're talking about huge numbers here, in no way detectable by someone over a couple of tries.
My description might not be entirely right (different RNG works slightly differently) but there's no list involved and certainly no human intervention. In fact, it's been proved that if you take two sequences of numbers, say the first one was created by a human and the second using a RNG, then it's quite easy to see that mathematically, the RNG will give you a sequence that could be random but the human will always have patterns.
I'm no expert here either but one of the major flaw of humans when generating random numbers is that we tend to "even things out". For example, let's take "1,1,1,1,1" and "2,6,4,9,3". Observation one: "1,1,1,1,1" seems a lot less random than "2,6,4,9,3" right? Well, right AND wrong. Ok, I'll try to make this short but bear with me.
Right: It IS true that "1,1,1,1,1" is less random than "2,6,4,9,3". Why? Human beings are the product of evolution in nature. Nature is not random. If you live in ancient times and notice some sort of pattern in the stars, it can help you find directions, tell what time of year it is and so on. Basically, humans are good at recognizing patterns (that's one of the basic elements of intelligence). And nature is full of patterns, waiting for some smart human to find them. That's what chemistry, astronomy, physics, biology, statistics are all about. In the above sequence, any sane person would tell me that the next number is going to be 1 in the first sequence and well, unknown in the second. It comes down to this, if I drop a ball, will it fall down or up? Well, down. But why? Because every time I've dropped a ball in my life, the ball has gone down and there's no reason for me to think that it will be different this time.
BUT, the thing is, mathematics and computers are not like nature. That's why so many people struggle with math, sometimes it's intuitive but often it's not. The fact of the matter is, in all possible sequences of five numbers between 1 and 10, they both have the same chance of occuring. Don't get me wrong, there's is (a lot) of randomness in nature. It's just that human beings (have evolved and) are trained at detecting patterns and sometimes, we see patterns that aren't there (e.g. all those people who think they've discovered a new fantastic secret about how you can beat the odds of combat in civ3 by doing this and that).
Now I said something above about "evening things out". This is something everyone does. If you play at a slot machine and lose ten times, do you have a better chance of winning the 11th time? If you attack a spearman with a knight a lose 4hp in a row, do you have a better chance of winning with the next knight? I'm sure most people will say no and they're right. That's because mathematically, the numbers in the sequence are called independant (another big property of RNG's and true random things, like dice). It doesn't matter what happens with the first knight, the second knight will attack using independant numbers.
But the fact of the matter is (this is where my opinion starts...), it seems wrong. In fact, I would go so far as saying that the RNG in civ3 works too well. It's too random. And quite frankly, that's not how things work out in real life. The RNG needs to even things out. Now if you've followed me so far, please read until the end. I'm not against a tank losing to a spearman (it has never happened to me anyway). What bugs me is this. When the RNG gives you numbers, the law of large numbers (or the other one can't remember) tells us that after N of these numbers, assuming it's uniform discrete between 1-10, we'll get approximately N/10 ones, N/10 twos and so on. The problem is that N generally has to be big. In other words, "1,1,1,1,1" could happen but eventually, things will even out and you'll start getting 2's and 3's and the others. My point is this: random sequences have streaks in them (like "1,1,1,1,1") but the RNG in a game made for people should be built to minimize the length of those streaks. In other words, the number generator shouldn't be random. Or put another way, there should be an integrated system which tells the RNG "hey man, you've given me 1,1,1, now give me something bigger!".
Now how would this affect gameplay? Well, basically, it would mean that if you're very unlucky (losing a knight to warrior in open terrain) then the next knight would have (slightly) better odds than a completely random fight. Of course, you can't go overboard with this idea. Otherwise, you'd get in a situation where if you're really unlucky for a while, then you use a knight to attack a rifleman and hope to win. But there should be a little bit of short term compensation for being very unlucky (or lucky!). I think it would make the game more realistic. What do you think? In any case, thanks for reading.
Basically, it starts with a seed. That's a number generated (usually) by the internal clock of the computer. By using some sort of combination of the date and time (up to the millisecond), you get a number. Then, that number is fed into a function. This is the mysterious part. Essentially, this function is "chaotic". That means that it's very complicated and that, more importantly, if you start with a seed of say 0.5123, you'll get a very different number than if you had used 0.5124. The other important characteristic of this function is that you'll get something "random". I'll explain what this means below. To get the second "random" number, you feed the first one into the function and bingo, you've got what is essentially a random sequence of numbers. In Civ3, this new number is kept (if you keep the flag "keep seed" on) in the savegame. Next time you load a game, you're at the same point in the sequence.
The random in " " means basically that any sequence you'll get using this method will (using mathematical analysis) satisfy very precise mathematical conditions that a purely "theoretical" random variable would also satisfy. However, the sequence is not completely random, eventually, you can get back to your starting point. In fact, one of the properties of an RNG is how many iterations of the function will bring you back to your starting point, on average. The bigger the number, the better the RNG is. But we're talking about huge numbers here, in no way detectable by someone over a couple of tries.
My description might not be entirely right (different RNG works slightly differently) but there's no list involved and certainly no human intervention. In fact, it's been proved that if you take two sequences of numbers, say the first one was created by a human and the second using a RNG, then it's quite easy to see that mathematically, the RNG will give you a sequence that could be random but the human will always have patterns.
I'm no expert here either but one of the major flaw of humans when generating random numbers is that we tend to "even things out". For example, let's take "1,1,1,1,1" and "2,6,4,9,3". Observation one: "1,1,1,1,1" seems a lot less random than "2,6,4,9,3" right? Well, right AND wrong. Ok, I'll try to make this short but bear with me.
Right: It IS true that "1,1,1,1,1" is less random than "2,6,4,9,3". Why? Human beings are the product of evolution in nature. Nature is not random. If you live in ancient times and notice some sort of pattern in the stars, it can help you find directions, tell what time of year it is and so on. Basically, humans are good at recognizing patterns (that's one of the basic elements of intelligence). And nature is full of patterns, waiting for some smart human to find them. That's what chemistry, astronomy, physics, biology, statistics are all about. In the above sequence, any sane person would tell me that the next number is going to be 1 in the first sequence and well, unknown in the second. It comes down to this, if I drop a ball, will it fall down or up? Well, down. But why? Because every time I've dropped a ball in my life, the ball has gone down and there's no reason for me to think that it will be different this time.
BUT, the thing is, mathematics and computers are not like nature. That's why so many people struggle with math, sometimes it's intuitive but often it's not. The fact of the matter is, in all possible sequences of five numbers between 1 and 10, they both have the same chance of occuring. Don't get me wrong, there's is (a lot) of randomness in nature. It's just that human beings (have evolved and) are trained at detecting patterns and sometimes, we see patterns that aren't there (e.g. all those people who think they've discovered a new fantastic secret about how you can beat the odds of combat in civ3 by doing this and that).
Now I said something above about "evening things out". This is something everyone does. If you play at a slot machine and lose ten times, do you have a better chance of winning the 11th time? If you attack a spearman with a knight a lose 4hp in a row, do you have a better chance of winning with the next knight? I'm sure most people will say no and they're right. That's because mathematically, the numbers in the sequence are called independant (another big property of RNG's and true random things, like dice). It doesn't matter what happens with the first knight, the second knight will attack using independant numbers.
But the fact of the matter is (this is where my opinion starts...), it seems wrong. In fact, I would go so far as saying that the RNG in civ3 works too well. It's too random. And quite frankly, that's not how things work out in real life. The RNG needs to even things out. Now if you've followed me so far, please read until the end. I'm not against a tank losing to a spearman (it has never happened to me anyway). What bugs me is this. When the RNG gives you numbers, the law of large numbers (or the other one can't remember) tells us that after N of these numbers, assuming it's uniform discrete between 1-10, we'll get approximately N/10 ones, N/10 twos and so on. The problem is that N generally has to be big. In other words, "1,1,1,1,1" could happen but eventually, things will even out and you'll start getting 2's and 3's and the others. My point is this: random sequences have streaks in them (like "1,1,1,1,1") but the RNG in a game made for people should be built to minimize the length of those streaks. In other words, the number generator shouldn't be random. Or put another way, there should be an integrated system which tells the RNG "hey man, you've given me 1,1,1, now give me something bigger!".
Now how would this affect gameplay? Well, basically, it would mean that if you're very unlucky (losing a knight to warrior in open terrain) then the next knight would have (slightly) better odds than a completely random fight. Of course, you can't go overboard with this idea. Otherwise, you'd get in a situation where if you're really unlucky for a while, then you use a knight to attack a rifleman and hope to win. But there should be a little bit of short term compensation for being very unlucky (or lucky!). I think it would make the game more realistic. What do you think? In any case, thanks for reading.