Challange: Test combat odds yourself

Also, some people say 'random' when they mean 'uniform ... consider the story of tiler laying 95 white tiles and 5 black tiles. He was told to lay the 5 black tiles randomly ... when 2 of them turned up very close together, the person paying for the job was upset and said 'why are these two so close together' ... the answer: you said to lay them randomly and I did.
Yes!!

The only problem with any massive test involving thousands of tests does not really help a person in the short term. What I mean by this is you can flip a coin ten times but you will more likely than not not get a 50 50 heads to tails.

My personaly opinion of the odds is that overall they are accurate, but I am personally only ever going to remember the battles that I lose when the odds say I should not.
This is the point I was trying to make. :)

All in all, it's only a game. It isn't like we're in a casino, where the odds are in favor of the house, and the player is at a disadvantage. I have enough education in meaningless mathematics, along with some courses in computer programming to understand the behavior of "random" numbers in a computer. The Civ RNG doesn't seem to be weighted against the player. What is against the player is the bonuses that the AI is given.

Look up the SorenRand code in the SDK for more details.
 
Spoiler :
scoutepicwin.jpg


again, only 1 result (and notice the year - it was noble or higher, if there was any free wins I would have used it by now - and even with free wins you can still take damage) I like this one :D

I can't really add much else but to echo the points from other posts.
 
What I mean by this is you can flip a coin ten times but you will more likely than not not get a 50 50 heads to tails.
The probability of getting 5 heads in 10 tosses from a fair coin is 24.6%. The probability of getting 4, 5 or 6 heads is 65.6%.

Its funny, but increasing the number of coin tosses actually decreases the probability of actually getting exactly 50/50. For example, with 100 tosses, you only have a 8% chance of getting 50 heads. However, getting 40 to 60 heads goes up to 96.5%.
 
Its funny, but increasing the number of coin tosses actually decreases the probability of actually getting exactly 50/50.

Because the definition of "exactly half" becomes more precise :crazyeye: To the same precision it goes up drastically as you pointed out.
 
The probability of getting 5 heads in 10 tosses from a fair coin is 24.6%. The probability of getting 4, 5 or 6 heads is 65.6%.

Its funny, but increasing the number of coin tosses actually decreases the probability of actually getting exactly 50/50. For example, with 100 tosses, you only have a 8% chance of getting 50 heads. However, getting 40 to 60 heads goes up to 96.5%.
Probability can be counter intuitive.
In fact, say with rolling a die - you would expect roughly 1/6 of each number with a given number of rolls. But if (for each multiple of 6 rolls) you saw a set of results that claim exactly the same amount of each number was obtained, you'd think some fixing was going on.
Perhaps the game does a better job of approximating odds than some think...
 
Speaking of dice, for a realistic education in probability mechanics, may I suggest a few games of Yacht?

There's no way to "fix" that, unless you play with loaded dice. :lol:
 
I think that the RNG is random and doesn't favour the player when ahead in score. It's just that us humans have a selective memory and what we would call "random" would be completely different to a computer.

Off topic but a university studied and found that when you flip a fair coin once it's slightly advantaged to the side it starts on e.g. if you flip a coin when heads if facing up, you have a 51% chance of getting heads. Minor point but shows that only computers can be "truly random".
 
^

I thought computers weren't "truly random" because all random numbers are based on an algorithm that depends on a seed. Someone can correct me if I'm wrong.
 
Speaking of dice, for a realistic education in probability mechanics, may I suggest a few games of Yacht?

There's no way to "fix" that, unless you play with loaded dice. :lol:

is that the one with the 5 dice? I remember getting 5 of a kind 3 times in one game!! It seemed that 5 was my 'lucky number' since I'd nearly always score it with 5s.
 
is that the one with the 5 dice? I remember getting 5 of a kind 3 times in one game!! It seemed that 5 was my 'lucky number' since I'd nearly always score it with 5s.
That's the one. I love that game. Another good one is Zilch. Lots of fun with four people. :)
 
Computers are not truly random unless you spend some money to buy a hardware random number generator. These typically utilize actual measurements of a physical process that is truly random, like radioactive decay or the static from radio frequency receivers.

Flipping a coin is far more random than a computer's algorithmic random number generator (which are usually called "pseudo-random" because they are not truly random).

The problem with the RNG that Civ uses is that it is one of the worst types of RNG algorithms in common use. It is in the Linear Congruential family. It somewhat better than it could be because it is only using the high order 16 bits rather than all 32 bits. The full 32 bit integer generated using the method that it uses has the fine property of alternating between even and odd - if you get an even number, the next number is always odd (and vice versa). This is because the low order bit (the one representing the 1 position) alternates between 0 and 1. As I recall, the 2nd lowest order bit (representing the 2 position in the binary number) uses a patter than is "0011". They get more complex after that, but each bit in the binary number does follow its own completely regular pattern. Where each bit starts in its own sequence depends on the seed that is used. Throwing out the 16 low order bits makes the patterns harder to recognize (and more complex with longer periods). Another interesting property of the type of RNG is that if you take the numbers in the order they are generated and use each group of 3 as a set of x, y, z coordinates you find that all the numbers fall onto a set of planes (in this case it is not more than 16 since the number of planes does not exceed the number of bits in the output, and it is typically lower).

I would have gone with the Mersenne Twister myself (it is a a modified Twisted Generalized Feedback Shift Register Sequence (TGFSRS) type generator), or perhaps the SIMD-oriented variation (to take advantage of those parallel processing instructions on every CPU in PCs these days - although this version was not available when Civ4 was released, it may have been when BtS came out). It is, for most purposes, one of the best algorithm available. Given the amount of memory used by Civ4, the extra 2 kilobytes (or something like that) of memory that it would use is trivial. The random() function that comes with the Python that Civ4 comes with uses the MT algorithm.

Which brings me to an actual point. You don't have to "test combat odds". The combat is controlled by the software. You have the source code for the software. You can, therefore, just look at the program and see how it does what it does. If it alters the outcome for the player depending on any factor, like the current score, then code that does that will be present in the source code. If there is no such code, then it doesn't do that. No "looks like" or "seems like" or "its close", just "it does this" or "it doesn't do this".
 
Which brings me to an actual point. You don't have to "test combat odds". The combat is controlled by the software. You have the source code for the software. You can, therefore, just look at the program and see how it does what it does. If it alters the outcome for the player depending on any factor, like the current score, then code that does that will be present in the source code. If there is no such code, then it doesn't do that. No "looks like" or "seems like" or "its close", just "it does this" or "it doesn't do this".

I like this answer because to me it says, "If there were a screwy piece of code that did this someone would have found it by now."
 
I like this answer because to me it says, "If there were a screwy piece of code that did this someone would have found it by now."
Considering that God-Emperor is an accomplished modder, he most certainly would have found it. I think that he's given the best answer in this thread, so far.

Hopefully it is read by the OP.
 
wow, you're faithful.

OP is Mr. Know It All, he's not the one that is wrong, it's all of us!
I know. I just love showing a know-it-all excellent and well crafted proof that their argument is complete BS. I doubt that he'll be back, since the mounting majority of "wrong" people all agree that his point can't be right, and therefore by extension, he is incorrect.

But being a typical know-it-all, he is no doubt looking in a voyeuristic fashion, satisfied that he has stirred the hornet's nest. Sadly, he will gain no satisfaction, because we are not arguing with each other, and we are not flaming each other, which the original post was no doubt intended to provoke. He must now retreat, and go back under the bridge that he came from.

<Flowery Psychological Analysis> The End </Flowery Psychological Analysis>
 
one of the worst types of RNG algorithms in common use ... etc ... all the numbers fall onto a set of planes ... etc.

This has been said before but we're not playing a global weather simulator or a military comms analysis program here. It's a game, which flips a metaphorical coin over and over again. The crappiest of crappy ZX81 algorithms would be perfectly fit for purpose and give results absolutely indiscernable from randomness during play. A table of the numbers from 1 to 100 shuffled up and repeated in a loop would probably be fit for purpose - the only reason for including a better RNG in Civ would be to shut up people like the OP :)
 
Code:
int GetRandomNumber(void)
{
     return 4;    // random number obtained by rolling a fair die, 23/6/11
}
 
Back
Top Bottom