Suggestion: Calculate Attack Modifiers with Gauss's Formula

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Suggestion: Calculate Attack Modifiers with Gauss's Formula

      Hello everyone!

      I have a suggestion entailing a new, more accurate way that the randomness of battles can be calculated by the server.

      There is a formula that can be used to extract a random value from a pool of values that levels exponentially.
      It is called Gauss’s formula, after the mathematician Karl Friedrich Gauss who discovered it.

      The formula calculates the sum of numbers from 1 to n by multiplying n by 1 + n.

      The formula is below:

      1 + 2 + 3 + ... + n = ½ n (n + 1)

      For example, if you want to add together all the numbers from 1 to 10, you can take ½ 10 (10 + 1), which is ½ (110), which is 55.

      Cool, right?

      But how this can be implemented into the game?
      The answer is by finding a random % multiplier between 0.8 and 1.2 to multiply to the raw damage value. This number would be recalculated each iteration, and there is a greater chance of getting a number close to 1 than a number towards the extremes.

      For example, let's say a unit has 4.0 attack power. We'll multiply by 10 to get a whole number, so 4.0 x 10 = 40.
      (4.0 is already whole, but sometimes there will be decimal attack values, so that's why this is necessary)
      Next, we'll substitute n for 40 in Gauss's formula. ½ 40 (40 + 1) = ½ 40 (41) = ½ (1640) = 820.

      Here's how this can be used in the game to make it simpler for the servers to choose a random multiplier:
      Let's keep using our 4.0 attack power example.

      1. After multiplying the attack value by 100 (4 x 10 = 40), the product is split into all numbers from 1 to n. In this example, it would be 40, 39, 38, 37, 36, and so on until 1.
      2. Then, the system will need to eliminate values that will bring the result 20%, so it will first multiply the product of Gauss's forumla (820) by 0.8. This will give us 656.
      3. Next, the system will add the numbers from step 1 to each other, starting with the highest number (in this case, 40). It would continue doing so until it reaches the number from step 2 (656).
      4. All numbers that were added before 656 was reached will be "disacrded" and won't be used to multiply because they will produce a result that is more than 20% off the original value. In this case, adding the numbers from 40 down to 19 will give us 649, and then adding 18 will give us 667. All the numbers 19 and higher (but not 18) will be discarded.
      5. The remaining values (in this case, 1 through 18) are put in a pool.
      6. To ensure that values closer to 1 are chosen, each value will get additional numbers of their value Ɐ (opposite value). For example, 1Ɐ is 18, and 4Ɐ is 15. Thus, in this example, the value 1 will get 18 numbers of itself in the pool, the value 2 will get 17 numbers of itself in the pool, and so on until the value 18, which only gets 1 number in the pool.
      7. Randomly, the system picks one value from the pool.
      8. The number that is picked from the pool is squared.
      9. Also randomly, the system picks to make the value positive or negative.
      10. Then, the value is added or subtracted from the result of Gauss's formula (In this case 820). Let's say the value 4 is picked from the pool. 4 squared is 16. The computer chooses it to be negative. 820 + (-16) = 820 - 16 = 804.
      11. Now, the system will find 804 as a percentage of 820. It's about 98%.
      12. Lastly, the attack value (originally 0.4) is multiplied by the decimal form of the percentage (0.98) and the result is the new attack value! 0.39!
      Of course, there will need to be a new modifier every iteration. For this, the system starts at step 7, because the pool of values will be the same.

      What do you guys think?
      Judy Hopps, fearless officer, devoted to protecting Zootopia and all of its creatures.
    • I'm not Albert Einstein, so I entrust that you know what you're talking about when you say that this method will be accurate in finding "randomness" multipliers.

      However, this would need foolproof testing before it gets implemented.

      And frankly I don't see why we need this in the first place, isn't the current method working fine?
      "CoN is a game of 80% skill and 20% luck" - Tifo_14

      "I don't get paid enough to do anything" - Germanico

      Nothing stops the Tifo :thumbup:
    • We'll need proof that it will work, for your acception into Harvard.
      "YES WE CAN!" - Barack Obama
      Mr. Gorbechev, tear down this wall! - Ronald Reagan
      We choose to go to the moon in this decade and do other things. John F. Kennedy
      The only thing we need to fear is fear itself. - Franklin D. Roosevelt

      Do not let anyone tell you who you are. - Kamala Harris
    • Judy Hopps wrote:

      Hello everyone!

      I have a suggestion entailing a new, more accurate way that the randomness of battles can be calculated by the server.

      There is a formula that can be used to extract a random value from a pool of values that levels exponentially.
      It is called Gauss’s formula, after the mathematician Karl Friedrich Gauss who discovered it.

      The formula calculates the sum of numbers from 1 to n by multiplying n by 1 + n.

      The formula is below:

      1 + 2 + 3 + ... + n = ½ n (n + 1)

      For example, if you want to add together all the numbers from 1 to 10, you can take ½ 10 (10 + 1), which is ½ (110), which is 55.

      Cool, right?

      But how this can be implemented into the game?
      The answer is by finding a random % multiplier between 0.8 and 1.2 to multiply to the raw damage value. This number would be recalculated each iteration, and there is a greater chance of getting a number close to 1 than a number towards the extremes.

      For example, let's say a unit has 4.0 attack power. We'll multiply by 10 to get a whole number, so 4.0 x 10 = 40.
      (4.0 is already whole, but sometimes there will be decimal attack values, so that's why this is necessary)
      Next, we'll substitute n for 40 in Gauss's formula. ½ 40 (40 + 1) = ½ 40 (41) = ½ (1640) = 820.

      Here's how this can be used in the game to make it simpler for the servers to choose a random multiplier:
      Let's keep using our 4.0 attack power example.

      1. After multiplying the attack value by 100 (4 x 10 = 40), the product is split into all numbers from 1 to n. In this example, it would be 40, 39, 38, 37, 36, and so on until 1.
      2. Then, the system will need to eliminate values that will bring the result 20%, so it will first multiply the product of Gauss's forumla (820) by 0.8. This will give us 656.
      3. Next, the system will add the numbers from step 1 to each other, starting with the highest number (in this case, 40). It would continue doing so until it reaches the number from step 2 (656).
      4. All numbers that were added before 656 was reached will be "disacrded" and won't be used to multiply because they will produce a result that is more than 20% off the original value. In this case, adding the numbers from 40 down to 19 will give us 649, and then adding 18 will give us 667. All the numbers 19 and higher (but not 18) will be discarded.
      5. The remaining values (in this case, 1 through 18) are put in a pool.
      6. To ensure that values closer to 1 are chosen, each value will get additional numbers of their value Ɐ (opposite value). For example, 1Ɐ is 18, and 4Ɐ is 15. Thus, in this example, the value 1 will get 18 numbers of itself in the pool, the value 2 will get 17 numbers of itself in the pool, and so on until the value 18, which only gets 1 number in the pool.
      7. Randomly, the system picks one value from the pool.
      8. The number that is picked from the pool is squared.
      9. Also randomly, the system picks to make the value positive or negative.
      10. Then, the value is added or subtracted from the result of Gauss's formula (In this case 820). Let's say the value 4 is picked from the pool. 4 squared is 16. The computer chooses it to be negative. 820 + (-16) = 820 - 16 = 804.
      11. Now, the system will find 804 as a percentage of 820. It's about 98%.
      12. Lastly, the attack value (originally 0.4) is multiplied by the decimal form of the percentage (0.98) and the result is the new attack value! 0.39!
      Of course, there will need to be a new modifier every iteration. For this, the system starts at step 7, because the pool of values will be the same.

      What do you guys think?
      SO...

      If I take an attack value 56.6, multiply by 10, that will give me 566. This formula can add all the numbers from 1 to 566, calculate which will give 80% of that, and then find their opposites?

      Seems pretty complicated to me.
    • The Destroyer 4 wrote:

      We'll need proof that it will work, for your acception into Harvard.
      That is why I like you D4, you have absolutely no compunction in creating brand new words to suit your expressions. Fearless.
      *** The Creator of Zombie Farming ***
      The KING of CoN News!!!
      The "Get off my lawn!" cranky CoN Forums Poster - not affiliated with Dorado in any way


      "Death comes to us all. Shall I deal you in?" - DoD
    • This is why I like you DOD, dragging your business into other peoples business for no reason. BOLD AND BRASH you are!
      "YES WE CAN!" - Barack Obama
      Mr. Gorbechev, tear down this wall! - Ronald Reagan
      We choose to go to the moon in this decade and do other things. John F. Kennedy
      The only thing we need to fear is fear itself. - Franklin D. Roosevelt

      Do not let anyone tell you who you are. - Kamala Harris
    • aplicar wax wrote:

      Am I the only one who sees this?
      Yes!
      "YES WE CAN!" - Barack Obama
      Mr. Gorbechev, tear down this wall! - Ronald Reagan
      We choose to go to the moon in this decade and do other things. John F. Kennedy
      The only thing we need to fear is fear itself. - Franklin D. Roosevelt

      Do not let anyone tell you who you are. - Kamala Harris
    • Dealer of Death wrote:

      I have a damn good reason, but let's not further derail this interesting suggestion.

      Judy Hopps wrote:

      Do you guys have ANY consideration for my suggestion to stay on topic?
      A'hem.
      *** The Creator of Zombie Farming ***
      The KING of CoN News!!!
      The "Get off my lawn!" cranky CoN Forums Poster - not affiliated with Dorado in any way


      "Death comes to us all. Shall I deal you in?" - DoD
    • Let me try this out. I'm not particularly good at maths, so correct me where I'm wrong.

      My unit will deal 20 damage on soft targets.

      Step 1: 20 x 10 = 200 --> 200, 199, 198, ... --> ,,, 3, 2, 1
      Step 2: 20% of 200 is 40, 200 - 40 = 160
      Step 3: I don't have the brain capacity to do the rest of this right now. Maybe later.
      Step 4:
      Step 5:
      Step 6:
      Step 7:
      Step 8:
      Step 9:
      Step 10:
      Step 11:
      Step 12:

      I'll pick this up tomorrow.
      "CoN is a game of 80% skill and 20% luck" - Tifo_14

      "I don't get paid enough to do anything" - Germanico

      Nothing stops the Tifo :thumbup:
    • Because it is my formula, I get to write these: 'Just say, "No"', and, "Oh Lord."

      There are many ways to compute pseudorandom values that conform to a desired probability distribution.

      If you knew the current distribution(s) CoN uses (I don't think you do) I'd spend a few seconds considering whether using a different distribution(s) might make CoN a better game.

      But - The way this suggestion is worded, the tail is definitely wagging the dog - And that is terrible way to run a railroad.

      Take this one out behind the barn and shoot it.
    • KFGauss wrote:

      Because it is my formula, I get to write these: 'Just say, "No"', and, "Oh Lord."

      There are many ways to compute pseudorandom values that conform to a desired probability distribution.

      If you knew the current distribution(s) CoN uses (I don't think you do) I'd spend a few seconds considering whether using a different distribution(s) might make CoN a better game.

      But - The way this suggestion is worded, the tail is definitely wagging the dog - And that is terrible way to run a railroad.

      Take this one out behind the barn and shoot it.
      What gives you the permission to speak authoritatively on this topic?

      And who are you really?
    • I got a 21st century public school 7th (IB) grade education... So I don't think I'll be able to do this.

      (I'll just watch, and respond)
      "YES WE CAN!" - Barack Obama
      Mr. Gorbechev, tear down this wall! - Ronald Reagan
      We choose to go to the moon in this decade and do other things. John F. Kennedy
      The only thing we need to fear is fear itself. - Franklin D. Roosevelt

      Do not let anyone tell you who you are. - Kamala Harris