1. New to the forums? Check out our Mentorship Program!
    Our mentors will answer your questions and help you become a part of the community!
  2. Welcome to Smogon Forums! Please take a minute to read the rules.

Gen 2 GSC Research Thread

Discussion in 'Ruins of Alph' started by rory, Feb 22, 2010.

  1. rory

    rory T^T
    is a Site Staff Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Oct 13, 2007
    Messages:
    210
    In the (hopefully near) future, old generations will need to be implemented in a simulator. At the moment there is not enough information to simulate these generations with 100% accuracy. Formulas exist at upokecenter.com but they really need to be confirmed / corrected before we use them. Below are some formulas that I think we should tackle first. When proving a formula I'd like to see the data and math you used to prove it, so be sure to be organized when collecting data. Most of these formulas should be the same as RBY but they should definitely be tested in both to confirm this.

    When I feel sufficient research has been done I'll be writing an article documenting all the information.

    Calculated Stat Formula:
    Needs confirmation.
    Code:
    Stat = int(((A+B)*2+C)*D/100)+E
     
    [LIST]
    [*]A = Pokémon's Base Stat.
    [*]B = Pokémon's Deter Value (from 0 through 15)
    [*]C = Number of Stat Points currently earned (from 0 through 63)
    [*]D = Pokémon's level.
    [*]E = Additive. When calculating a Pokémon's HP, use (Level + 10). For all other stats, use 5.
    [/LIST]
    
    Stat Point Formula:
    Fixed
    Code:
    Stat Points = (SQRT(MAX(MIN(StatExp,32505),1)-1)+1)/4
    
    HP DV Formula:
    trust this formula; it doesn't really need to be tested
    Code:
    HP DV = A + B + C + D
     where:
     
    [LIST]
    [*]A=0. If Attack DV is odd, A=8.
    [*]B=0. If Defense DV is odd, B=4.
    [*]C=0. If Speed DV is odd, C=2.
    [*]D=0. If Special DV is odd, D=1.
    [/LIST]
    
    Damage Formula:
    Here is the damage formula from upokecenter. Even on the DP one from upokecenter, they don't include the mods so I'm entirely sure how accurate their damage formulas are. Everything on that page needs to be tested for accuracy.
    Code:
    int(int(int(2×L ÷ 5+2)×A×P ÷ D)/50)+2
     where:
     
    [LIST]
    [*]L = Attacker's Level
    [*]A = Attacker's current Attack/Special Attack value
    [*]P = Attack's base damage
    [*]D = Defender's current Defense/Special Defense
    [/LIST]
    
    I'll be adding to this post with more things that need to be researched.
  2. .Maguss.

    .Maguss.

    Joined:
    Jan 31, 2009
    Messages:
    210
    The stat point formula is alright from what I can tell. The game changes the 0 to 1 in the formula to calculate the Stat Points. Also, values higher than 65025 aren't computed. This is why you need just 63002 stat exp. to obtain max stats (this could be proved with a cheating device).
  3. david stone

    david stone Fast-moving, smart, sexy and alarming.
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Aug 3, 2005
    Messages:
    5,150
    The reason the damage formula looks especially wrong is because of how the site is laid out. They have the damage formula spread across two pages. The next page goes on to say this:

    However, I doubt that all of this is correct.
  4. .Maguss.

    .Maguss.

    Joined:
    Jan 31, 2009
    Messages:
    210
    Damage = int((min(int(int(((2 + int(0.4 * L)) * A * P) / D) / 50) , 997) + 2)
    * X)

    L: Your level.
    A: Your Attack/Special Attack stat.
    P: The move's power.
    D: The opponent's Defense/Special Defense.
    X: Extra multipliers:
    Each multiplier has default value 1.
    1. Type1 = The type matchup of Attack Type (if called for) against Opponent's
    Type 1.
    2. Type2 = The type matchup of Attack Type (if called for) against Opponent's
    Type 2 (if different than Type 1). If opponent's Type 1 and Type 2 are the
    same, this is 1.
    3. STAB = 1.5 if Attack Type (if called for) matches either user's Type 1 or
    Type 2.
    4. Item = 1.1 if Item is of variety Type Boost and Item Boost Type matches
    Attack Type (if called for).
    5. Sunny Day = If weather is Sun, 1.5 if attack has type Fire, 0.5 if attack
    has type Water.
    6. Rain Dance = If weather is Rain, 1.5 if attack has type Water, 0.5 if
    attack has type Fire or is named "Solarbeam".
    7. Pursuit = 2 if opponent's action for turn is "Switch" and if move is named
    "Pursuit".
    8. Dig = If opponent's status is Underground, 2 if attack is named
    "Earthquake" or "Magnitude", 1 if attack is named "Fissure", 0 if attack is
    named anything else.
    9. Fly = If opponent's status is Airborne, 2 if attack is named "Gust" or
    "Twister", 1 if attack is named "Thunder", 0 if attack is named anything else.
    10. Minimize = 2 if opponent's Evade modifier is greater than 0, if Minimize
    is responsible for at least one point on evade modifier, and if move is named
    "Stomp"
    11. Critical Hit = 2 if a random 8-bit number falls into an active Critical
    Hit Domain.
    12. Random Number = (217 + randInt(0,38)) / 255

    From the Strategy Guide, by RJones. Not sure if this is the correct formula though.

    EDIT:
    Type 1 - x0, x0.5, x1, or x2 based on the matchup of attack type vs.
    opponent's Type 1
    Type 2 - x0, x0.5, x1, or x2 based on the matchup of attack type vs.
    opponent's Type 2, if any
  5. Beowolf

    Beowolf

    Joined:
    Jun 19, 2008
    Messages:
    8
    So is using an emulator to test these things acceptable? *ready to go gather data to confirm(or at least support) the stat formula*
  6. poccil

    poccil
    is a Researcher Alumnus

    Joined:
    Jun 18, 2007
    Messages:
    400
    I would like to correct the Hidden Power formula given in the Smogon page. The Y value in the formula is incorrect; it actually refers to the remainder of the Special DV divided by 4. I could confirm this through testing. I've modified my attack description and it now reads:

Users Viewing Thread (Users: 0, Guests: 0)