Announcement

Collapse
No announcement yet.

Question about random seed test

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

  • Question about random seed test

    Well, hmmm.

    I've been doing some testing.
    I wish I had the numbers in front of me but I'm at the office right now and I can only share my limited conclusions.

    Like most of you I had seen streaks that have made me blanch, so I wanted to try and figure out how the RN generator was working.

    I placed 3 artillery, 6 horsemen, 3 sword men, 2 pike men and a warrior in three stacks, within striking range of four stacks that consisted of unfortified 2 horsemen, a bowman, a pike man and a warrior. All are on desert tiles with no modifiers.

    I re-loaded the same turn around 30 times and attacked with 5 different combinations of units and tried to spot a pattern. My main questions were: is the queue fixed for all battles? Is there a unit specific queue? And if not, then what determines a change in queue.

    Example of a combination would be
    1st attack hm(1st stack) attack, swm(1st stack)
    2nd swm(1st stack) attack, pm(1st stack)
    3d hm (1st stack) attack, hm(2nd stack)
    4th pkm(2nd stack) attack, w(3d stack)
    5th hm (3d stack) attack, hm(4th stack)

    If I used the same combination twice I’d invariably get the same result, pointing towards a fixed queue of seeds. However, if I changed only one of the attacks, ie replaced

    2nd attack swm(1st stack) attack, pm(1st stack)
    with hm(1st stack) attack, pm(1st stack)

    then the result for 3d, 4th and 5th attacks would change also. That meant that when my hm used, supposedly, the third seed in the queue for the same battle as last time, it gave different result. Hence, a different seed was used.

    To make it clearer:
    You don't exactly reset the queue, but somehow branch out into another queue, because no matter what combination you use you'll always get the same result for that combination, and if you have an inclination for save-cheating, you can reload until you find a combination that is in your favour. If I didn't like the result from my multi-battle combat I just have to reload and change the order of attack.

    Anyone have any theories as to how that may be working?

    Zap
    Last edited by zapperio; November 23, 2001, 12:40.

  • #2
    Considering how much speculation there has been around the combat system I'd have thought there would be more interest in the actual mechanics of said system?

    Zap

    Comment


    • #3
      For god's sake, haven't people figured out by now that the random number generator generates a queue of random numbers which are then FIXED for that particular turn ?

      or are they too busy pretending that a new number is generated every time a unit attacks ?

      Comment


      • #4
        Originally posted by Rakki
        For god's sake, haven't people figured out by now that the random number generator generates a queue of random numbers which are then FIXED for that particular turn ?

        or are they too busy pretending that a new number is generated every time a unit attacks ?
        Exactly who are you addressing this to? Maybe you'd like to actually read the post before replying?

        I think my post makes it abundantly clear combat is not solved with something as simple as a single fixed queue.

        Zap

        Comment


        • #5
          After reloading, do the results change if you atack with a different unit of the same type or with another type of the same attack rating?

          Example: If you attack with Horseman (first stack) then Swordsman (second stack), are the results different then if you used Horseman (second stack) or Archer (first stack) first?

          Also, would the results change for the second unit if you use either a different unit of the same type or a different type with the same attack?

          These experiments would tell us whether the seed is dependant on the unit type, unit attack rating, or the specific instance of the unit. I'm not sure what use this data would be, but it would bring a step closer toward understanding how the combat system works.

          Comment


          • #6
            Originally posted by Excelsior
            After reloading, do the results change if you atack with a different unit of the same type or with another type of the same attack rating?

            Example: If you attack with Horseman (first stack) then Swordsman (second stack), are the results different then if you used Horseman (second stack) or Archer (first stack) first?

            Also, would the results change for the second unit if you use either a different unit of the same type or a different type with the same attack?

            These experiments would tell us whether the seed is dependant on the unit type, unit attack rating, or the specific instance of the unit. I'm not sure what use this data would be, but it would bring a step closer toward understanding how the combat system works.
            Exactly my point. A little understanding of the combat system might tell us more about the occurances of streaks that people have been reporting.

            Of course the easiest thing would be to ask firaxis about this but I'm not sure if that is an option at this point.

            To answer your questions: (which were the ones I had when I did the experiment, incidently)

            I thought I had made this clear in the above post, but I guess it may require a bit more careful reading than intended. Let me try again, and now that I'm home I can use my numbers to back me up.

            After reloading, do the results change if you atack with a different unit of the same type or with another type of the same attack rating?

            Example: If you attack with Horseman (first stack) then Swordsman (second stack), are the results different then if you used Horseman (second stack) or Archer (first stack) first?
            When I did a combination of five attacks I would get a different combat result depending of the order of the attacks.

            The way I tested this was by changing only one attack in the combination.

            i.e. 1st attack: (1st stack) reg horseman vs (1st stack)veteran horseman
            2nd attack: (1st stack) reg swordman vs (1st stack reg pikeman)
            3d attack: (1st stack) elite horseman vs (2nd stack veteran bowman)
            ...

            Then I'd reload and change only second attack.

            1st attack: (1st stack) reg horseman vs (1st stack)veteran horseman
            2nd attack: (1st stack) reg swordman vs (3d stack reg swordman)
            3d attack: (1st stack) elite horseman vs (2nd stack veteran bowman)
            ...

            Now, you notice the third attack is exactly the same and should be using the same random seed as before the reload, but I'd consistantly get different outcome out of that attack depending on what I did with my second attack.

            Mind you, those outcomes are fixed also, so there is obviously a sort of a branching queue being used.

            I'm sure other people have noticed this, but I tested it thoroughly, and the results are unit dependent. That is if you have a stack of 3 horsemen and a swordman and you attack 3 times agains the same stack. ie

            1st attack horseman
            2nd attack swordman
            3d attack horseman

            you will get different result for the last two attacks if you go horseman in all three attacks.

            There is no distinction made between reg, vet, or elite, for either outcome or branching.

            Zap

            Comment


            • #7
              Originally posted by zapperio
              I thought I had made this clear in the above post, but I guess it may require a bit more careful reading than intended. Let me try again, and now that I'm home I can use my numbers to back me up.

              When I did a combination of five attacks I would get a different combat result depending of the order of the attacks.

              The way I tested this was by changing only one attack in the combination.

              i.e. 1st attack: (1st stack) reg horseman vs (1st stack)veteran horseman
              2nd attack: (1st stack) reg swordman vs (1st stack reg pikeman)
              3d attack: (1st stack) elite horseman vs (2nd stack veteran bowman)
              ...

              Then I'd reload and change only second attack.

              1st attack: (1st stack) reg horseman vs (1st stack)veteran horseman
              2nd attack: (1st stack) reg swordman vs (3d stack reg swordman)
              3d attack: (1st stack) elite horseman vs (2nd stack veteran bowman)
              ...

              Now, you notice the third attack is exactly the same and should be using the same random seed as before the reload, but I'd consistantly get different outcome out of that attack depending on what I did with my second attack.

              Mind you, those outcomes are fixed also, so there is obviously a sort of a branching queue being used.

              I'm sure other people have noticed this, but I tested it thoroughly, and the results are unit dependent. That is if you have a stack of 3 horsemen and a swordman and you attack 3 times agains the same stack. ie

              1st attack horseman
              2nd attack swordman
              3d attack horseman

              you will get different result for the last two attacks if you go horseman in all three attacks.
              Zap
              What I meant was, does it change the branching if you use a different unit of the same type to attack or a different unit with the same attack? i.e., does it change the branching if the attack and defense values are the same in each case, but different units are used? The point I'm trying to get at is, do the units used affect the branching, or is it the A/D ratings of the units involved?

              Example:

              1st attack: (1st stack) reg horseman vs (1st stack)veteran horseman
              2nd attack: (1st stack) reg horseman vs (1st stack reg pikeman)
              3d attack: (1st stack) elite horseman vs (2nd stack veteran bowman)

              If we change the second attack to this,

              2nd attack: (1st stack) reg archer vs (1st stack reg pikeman)

              this,

              2nd attack: (1st stack) reg horseman vs (2nd stack reg pikeman)

              or this,

              2nd attack: (2nd stack) reg horseman vs (1st stack reg pikeman)

              what are the results? In each case the A/D is the same, but the units used are different.

              Comment


              • #8
                Originally posted by Rakki
                For god's sake, haven't people figured out by now that the random number generator generates a queue of random numbers which are then FIXED for that particular turn ?

                or are they too busy pretending that a new number is generated every time a unit attacks ?
                Actually a random function is most likely called everytime a random number is needed(including every 'round' of combat). There is no way to know how large of a queue you would need for a turn and it would be pointless to make one since it would make no difference in the sequence of numbers.

                Oops, I just noticed the thought about unit queues or whatever, but I still think they are not used for the same reasons.

                Comment


                • #9
                  About the results.....

                  All of this seems akin to something I used to experience in an old game called "X-COM".

                  At the end of a turn, if I saved and then reloaded the turn 15 times, I'd get the same results everytime. However, if I made even the smallest change, ie, crouch a trooper that was completely out of the battle, the whole results were changed.

                  So I tend to think that there is a fixed queue of numbers.

                  The whole mechanics must be figured out though before we make a final assumption.

                  Cavalier

                  Comment


                  • #10
                    Interesting results, Zap. However, it seems most people on this forum are 13-year olds who don´t understand the point you are trying to make. Pay no attention to them, and please, keep on testing.

                    I´m especially interesting in seeing if changing the instance of a unit changes the results, i.e. if the results differ when attacking with different tanks in the same stack.

                    Also, my own experiences suggest that just moving around units would not change the random seed. I claim this mostly on the fact that attacks and events during the enemies´ turn are identical even if you walk around with units and make small "end of turn" changes (that is, after you have made all your attacks).

                    Comment


                    • #11
                      I seem to remember seeing somewhere that there were several different seed variables used - one for combat, another for other random occurances etc.

                      If the combat seed were used like this it may give the kind of results that we are seeing:

                      Assume we have a random number generator function, rng(), that accepts a seed as input and returns both the required random number and a new seed for use with the next random number.

                      Also assume that each military unit has a unique identifying number.

                      Then you calculate the next random number like this:

                      next_random_number = rng( current_seed + attacker_id + defender_id )

                      This would also generate a new seed (not shown above).

                      This would mean that the random number generated would depend not only on the previously generated on, but also which units were actually involved in combat.

                      Of course, there are a near-infinite number of ways that you can implement this kind of stuff, so the chances of anyone successfully guessing the actual algorithm used are quite low...

                      Comment


                      • #12
                        Originally posted by zapperio


                        Exactly who are you addressing this to? Maybe you'd like to actually read the post before replying?

                        I think my post makes it abundantly clear combat is not solved with something as simple as a single fixed queue.

                        Zap
                        There's fixed outcomes to prevent "reload combat cheaters". If you do something to reset the rng, you get a different outcome.

                        Comment


                        • #13
                          Originally posted by Hurry
                          keep on testing.
                          thx for the vote of confidence

                          I´m especially interesting in seeing if changing the instance of a unit changes the results, i.e. if the results differ when attacking with different tanks in the same stack.
                          That was one of my questions also and upon testing I noticed no difference. Neither did experience of a unit have any impact.

                          Also, my own experiences suggest that just moving around units would not change the random seed. I claim this mostly on the fact that attacks and events during the enemies´ turn are identical even if you walk around with units and make small "end of turn" changes (that is, after you have made all your attacks).
                          That had been my experience also and so I tested it and we are right. Unit movements between attacks does not change the queue.

                          Zap

                          Comment


                          • #14
                            Originally posted by GP


                            There's fixed outcomes to prevent "reload combat cheaters". If you do something to reset the rng, you get a different outcome.
                            There is not a simple reset either as all possible outcomes are fixed and "reload combat cheating" has not been prevented except for a single unit battle.

                            Zap

                            Comment


                            • #15
                              Originally posted by Excelsior


                              What I meant was, does it change the branching if you use a different unit of the same type to attack or a different unit with the same attack? i.e., does it change the branching if the attack and defense values are the same in each case, but different units are used? The point I'm trying to get at is, do the units used affect the branching, or is it the A/D ratings of the units involved?
                              Ok I see what you're asking. Based on my results it is a/d rating that makes a difference, and stacks. I have not tested this fully, but preliminary result show that if all hm are from the same stack it will make no difference in what order they go as long as they attack the same units in order.

                              I need to fully test whether difference in stacks matters. i.e.

                              replace 2nd attack hm (stack 1) vs pm (stack 2)

                              with

                              2nd attack hm (stack 2) vs pm (stack 2)
                              or
                              2nd attack hm (stack 1) vs pm (stack 1)
                              or
                              2nd attack hm (stack 2) vs pm (stack 1)

                              My numbers lead me to believe that it will change the results but I did not test this specifically. I only had 4 enemy stacks to play with.

                              Zap
                              Last edited by zapperio; November 24, 2001, 23:28.

                              Comment

                              Working...
                              X