Gen 2 GSC Research Thread

rory

T^T
is a Site Content Manager Alumnusis a Battle Simulator Moderator Alumnus
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.
 

gumnas

formerly .Maguss.
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).
 

obi

formerly david stone
is a Site Content Manager Alumnusis a Programmer Alumnusis a Senior Staff Member Alumnusis a Smogon Discord Contributor Alumnusis a Researcher Alumnusis a Top Contributor Alumnusis a Battle Simulator Moderator Alumnus
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:

[url=http://www.upokecenter.com/games/gs/guides/attack.php]upokecenter[/url] said:
After that, the damage is calculated. See the Damage Formula. In this step, the game also checks if an item is attached to a Pokémon.

After the damage is calculated, the amount of damage is revised by these four factors:

* Weather. Sunny Day increases the damage of fire-type attacks by 50% and decreases the damage of water-type attacks by 50%. Rain Dance increases the damage of water-type attacks by 50%, decreases the damage of fire-type attacks by 50%, and halves the damage done by Solarbeam.
* Badges. In the Gold/Silver/Crystal version, the Johto and Kanto badges increase damage of the appropriate attack type to 9/8 (multiply damage by 9; divide by 8) (in internal battles only). For instance, the Hive Badge increases damage from the player's Bug-type attacks.
* Same Type Attack Bonus. If the attack type shares a type with one of the user's types, then damage is multiplied by 1.5.
* Types of attacker and defender. The damage calculated is multiplied by the number that is extracted. See the Type Effectiveness page. As an exception, after the attacker uses Foresight, normal and fighting attacks become normal-effective to the Ghost type.

Finally, in a process called "damage weighting", a random number from 217 through 255 is multiplied in the currently calculated damage, and divided by 255.
However, I doubt that all of this is correct.
 

gumnas

formerly .Maguss.
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
 
So is using an emulator to test these things acceptable? *ready to go gather data to confirm(or at least support) the stat formula*
 
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:
This attack's base damage is equal to ((A*5+(B mod 4))/2)+31, rounded down, where A is 0, plus 8 if the user's Attack Deter Value (DV) is 8 or more, plus 4 if its Defense DV is 8 or more, plus 2 if its Speed DV is 8 or more, plus 1 if its Special DV is 8 or more, and B is the user's Special DV. This attack's type is equal to (A mod 4)*4+(B mod 4), where A is the user's Attack DV and B is its Defense DV, and is selected from this list: 0 = Fighting; 1 = Flying; 2 = Poison; 3 = Ground; 4 = Rock; 5 = Bug; 6 = Ghost; 7 = Steel; 8 = Fire; 9 = Water; 10 = Grass; 11 = Electric; 12 = Psychic; 13 = Ice; 14 = Dragon; 15 = Dark. ("X mod Y" means "the remainder of X divided by Y.")
 

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top