Announcement

Collapse
No announcement yet.

Random Numbers

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Random Numbers

    In case no one's mentioned it before, I thought I'd explain a little about how "random" numbers on a computer work. Computers have no way of generating truly random numbers. Rather, they generate what are called "pseudorandom" numbers - numbers that are generated using a mathematical formula but in such a way that they look random.

    Each sequence of random numbers is defined by a "seed" number fed into the random number generator at the beginning. If you start from the same seed every time, you get the same sequence of numbers every time. If you start from different seeds (for example, by basing the seed on the date/time when the program is started), you get different sequences.

    What Firaxis appears to be doing is saving the current state of the random number generator in the save file so when the game is reloaded, the random number generator picks up right where it left off. That provides a simple yet elegant way of making sure if people reload a game and do the same things, they will get the same results. Assuming I'm right, all they have to store is about one or two numbers, and two entire games will go the same way from 4000 BC to 2050 AD if the player does exactly the same things. Whether that's a good thing or a bad thing, of course, is a matter of personal taste .

    Nathan

  • #2
    It sounds like some sort of predestination, and that sounds like something bad.

    Comment


    • #3
      Re: Random Numbers

      Originally posted by nbarclay
      In case no one's mentioned it before,
      Nathan


      Sorry, couldn't resist.

      Comment


      • #4
        Originally posted by Oligarf
        It sounds like some sort of predestination, and that sounds like something bad.
        I suppose someone could call it "bad" in some metaphysical sense, but in practical terms, the only difference it makes is that you can't change the results by reloading. (That and tournament games presumably go the same way for different players until their actions start creating divergences, which probably makes things a little fairer.)

        If you think about it, the deal in a card game is similarly predestined by the shuffle. But since no one knows the results of the shuffle until the cards are dealt, why does it matter? Think of the calculation of the "seed" as the shuffle and the actual calculation of the numbers as the deal.

        Nathan

        Comment


        • #5
          [If you think about it, the deal in a card game is similarly predestined by the shuffle. But since no one knows the results of the shuffle until the cards are dealt, why does it matter? Think of the calculation of the "seed" as the shuffle and the actual calculation of the numbers as the deal.

          Nathan
          That's a good analogy with the cards Nathan. I noticed the same thing one time when I called b.s. on my tank losing to a spearman. Upon reloading, the tank kept getting killed. I found that if I attacked with units in a different order after reloading, the spearmen no longer had the Rambo-type explosives spears and my tank didn't die.

          -Apolex

          [edited to include quote]

          Comment

          Working...
          X