Please donate money and help me raise over $3100 for my education.

Pokemon Ruby/Sapphire - Various Notes

Values derived from a Pokemon's ID

Each Pokemon comes with a 32 bit identifier, generated at random, which determines significant information about the uniqueness of the Pokemon.

Nature

The ID modulo 25 identifies the nature of a Pokemon. Shown here are the taste preferences of Pokemon with those natures (what PokeBlocks they like), and the stats to increase and decrease.

Hex Nature Like Dislike Stat increase Stat decrease
00Hardy(neutral)
01LonelySpicySour+Attack-Defense
02BraveSpicySweet+Attack-Speed
03AdamantSpicyDry+Attack-Special Attack
04NaughtySpicyBitter+Attack-Special Defense
05BoldSourSpicy+Defense-Attack
06Docile(neutral)
07RelaxedSourSweet+Defense-Speed
08ImpishSourDry+Defense-Special Attack
09LaxSourBitter+Defense-Special Defense
0ATimidSweetSpicy+Speed-Attack
0BHastySweetSour+Speed-Defense
0CSerious(neutral)
0DJollySweetDry+Speed-Special Attack
0ENaiveSweetBitter+Speed-Special Defense
0FModestDrySpicy+Special Attack-Attack
10MildDrySour+Special Attack-Defense
11QuietDrySweet+Special Attack-Speed
12Bashful(neutral)
13RashDryBitter+Special Attack-Special Defense
14CalmBitterSpicy+Special Defense-Attack
15GentleBitterSour+Special Defense-Defense
16SassyBitterSweet+Special Defense-Speed
17CarefulBitterDry+Special Defense-Special Attack
18Quirky(neutral)
Note that preference to certain tastes affects a Pokemon's stats. For instance, if a Pokemon's nature indicates that it likes spicy, its Attack will increase, but if not, its Attack will decrease.

Gender

The low byte of the ID contains the Pokemon's gender value. According to the Pokemon, this byte could mean that the Pokemon is male or female.
If Pokemon species is... Range of female
12.5% female0-30
25% female0-63
50% female0-126
75% female0-190
Of course, this byte is ignored if the species is genderless, always male, or always female. A Pokemon can have no gender at all, if it was obtained from Mirage Island. In that case, the gender value will be 0.

Unown shape

To find the Unown shape, take the lowest two bits in each byte of the ID, and combine them together:
A=(id>>24)&0x03;
B=(id>>16)&0x03;
C=(id>>8 )&0x03;
D=(id    )&0x03;
Unown=D|(C<<2)|(B<<4)|(A<<6);
The lowest 5 bits of the resulting byte contains the Unown shape.

Wurmple

If the remainder of Wurmple's ID divided by 10 is greater than or equal to 5, it will evolve into Cascoon; else Silcoon.

Individual Values

Individual Values range from 0 to 31. These values are important in determining the Pokemon's final stats. There are six Individual Values for HP, Attack, Defense, Speed, Special Attack, and Special Defense. They are randomly determined when you encounter a wild Pokemon or obtain a Pokemon internally.

Finding Individual Values

These formulas are not directly used in the game, as the Individual Values of a Pokemon are already available to it and hidden from view. Thus these formulas can only approximate the IVs of a Pokemon and are therefore for information only.

IV = ((ceil(S/PV)-5)*100/L)-2*B-floor(EV/4)

where:
  • ceil(X) = round up
  • floor(X) = round down
  • S = Stat (not the HP stat, which has a similar formula, see below)
  • PV = Personality, derived from the Pokemon's nature
  • L = Level
  • B = Pokemon's base stat
  • EV = Effort value for stat

HP IV = ((S-L-10)*100/L)-2*B-floor(EV/4)

The PV depends on the Pokemon's nature: it is initially equal to 1.

If the nature increases the stat by 10%, the PV is 1.1.
If the nature decreases the stat by 10%, the PV is 0.9.

Effort Values

The Effort Values or EVs, indicate the amount of training that a Pokemon has made. Whenever a foe Pokemon is defeated in an internal battle (wild or trainer), each Pokemon that participated in the battle against it will earn a number of EVs depending on the species of the Pokemon defeated. The limit that a Pokemon can earn is 510. A Pokemon can earn up to 255 EVs per stat (HP, Attack, Defense, Speed, Special Attack, Special Defense). A Pokemon begins with Effort Values of 0 for all stats. According to the stat formula (above), for a level 100 Pokemon, every 4 EVs increase the corresponding stat by 1.

The stat enhancers (HP Up, Protein, Iron, Carbos, Calcium, and Zinc, respectively) increase the EVs of the respective stat by 10. Each stat enhancer only takes effect if the EV for that stat is less than 100. After a stat enhancer is used and takes effect, the Pokemon's stats are recalculated. (Stat enhancers are also known as "vitamins".)

In the Emerald version, certain Berries can decrease a Pokemon's effort values by 10 (Pomeg Berry, Kelpsy Berry, Qualot Berry, Tamato Berry, Hondew Berry, and Grepa Berry, respectively).

The Macho Brace and the PokeRus virus each will double the EVs that a Pokemon will earn.

If a Pokemon is holding an Exp. Share, it will earn EVs as though it were one of the battle's participants. (If it has the PokeRus virus, its EV gain is doubled as usual.)

When your Pokemon has earned the maximum of 510 EVs, it can receive an Effort Ribbon in Slateport's outdoor market.

Rare Candy, like other methods of level gain, uses the Effort Values in stat calculation, contrary to rumors.

Effort Values are not obtained in battle when a Pokemon reaches level 100.

Stats

The game uses these formulas to find a Pokemon's stats. A Pokemon's stats are calculated whenever it gains a level or when the player encounters or receives it.

HP = int(int(A*2+B+int(C/4))*D/100)+D+10
Other Stats = int((int(int(A*2+B+int(C/4))*D/100)+5)*E)

where:

  • A = Pokemon's Base Stat
  • B = Pokemon's Individual Value
  • C = Pokemon's Effort Value
  • D = Pokemon's Level
  • E = Normally equal to 1.
If the Pokemon's nature increases the stat by 10%, E = (110/100).
If the Pokemon's nature decreases the stat by 10%, E = (90/100).

As an exception, Shedinja's HP is always 1 (its Base HP is 1).

Encounters

This section applies to the Ruby and Sapphire versions.

Each area has a probability of Pokemon appearing, expressed as a value of 1, 4, 9, 10, 20, 25, 30, and 35. Whenever the player takes a step in which Pokemon could appear, the game uses this formula:

X = Y * 16

where:

  • Y = Encounter value
  • If a random number from 0 to 2874 exclusive is less than X, a Pokemon will appear.

Modifications

  • If the Mach Bike or Acro Bike is used, multiply by 4/5.
  • If the Black Flute had been used, multiply by 1/2. If the White Flute had been used, multiply by 3/2.
  • If the first Pokemon in party has a Cleanse Tag, multiply by 2/3.
  • If the first Pokemon in party has Stench, multiply by 1/2. If the first Pokemon in party has Illuminate, multiply by 2/3. (In either case, ignore if the Pokemon holds a Cleanse Tag.)

Experience

Whenever a Pokemon defeats another Pokemon, it gains Experience points (EXP). The amount of EXP a Pokemon is worth is based on a formula shown below.

Formula used if no Pokemon in party is holding an Exp. Share:

Experience = int(int(L*G/7)/E)*X*Y*Z

Formula used if at least one unfainted Pokemon in party is holding an Exp. Share:

Experience = (int(M/E)*A+int(M/F)*B)*X*Y*Z

where:

  • L = Defeated Pokemon's level
  • G = Defeated Pokemon's Base Experience
  • X = If the battle is a Trainer battle, X=1.5; else 1.
  • Y = If the participating Pokemon's ID is different from the player's ID, Y=1.5; else 1 ("[name] gained a boosted [value] Exp. Points!")
  • Z = If the participating Pokemon is holding a Lucky Egg, Z=1.5; else 1.
  • M = int(int(L*G/7)/2)
  • E = Number of unfainted Pokemon that participated in the battle against the defeated Pokemon
  • F = Number of unfainted Pokemon that are holding an Exp. Share
  • A = If the Pokemon participated in the battle against the defeated Pokemon, A=1; else 0.
  • B = If the participating Pokemon is holding an Exp. Share, B=1; else 0.

Eggs and fainted Pokemon don't count as participants in a battle.

When a Pokemon gains a level, its current HP is its new HP minus the HP lost before the level gain.

After entrusting a Pokemon to the Day Care, it will earn 1 Exp. Point for each step the player walks.

Two growth rates were added in Ruby and Sapphire: their maximum experience values are 600,000 and 1,640,000.

See the Experience table.

Trainer ID

The trainer ID is 32 bits long. Only the lower 16 bits is visible - on the player's Trainer Card.

Shiny Pokemon

There is a 1/8192 chance that you will encounter a shiny Pokemon. Unlike in Gold/Silver/Crystal versions, whether a Pokemon is shiny is not based on its Individual Values. Shiny Pokemon will have a different color from normal Pokemon.

Shininess is based on the personality ID and the 32-bit trainer ID:

 A = PersonalityID XOR TrainerID
 B = A AND 0xFFFF
 C = (A >> 16) AND 0xFFFF
 D = B XOR C
 SHINY = (D < 8)

Notes on breeding

Breeding in Ruby and Sapphire is similar to breeding in previous versions.

Egg Waiting Time

X depends on the species and trainer ID of the Pokemon:

  • Same species, different ID: X=70
  • Same species, same ID: X=50
  • Different species, different ID: X=50
  • Different species, same ID: X=20

Every 256 steps after the two Pokemon are placed in the daycare, an egg will be ready if a random number from 0 through 99 is less than X. The baby will be calculated as soon as the egg is received.

Species

The species hatched from the egg is that of the female, usually, in the lowest stage. There are a few exceptions:
  1. One of the Pokemon can be a Ditto, but not both. The baby will be the species that isn't the Ditto, in the lowest stage. For the purposes of breeding, the Ditto will have the gender that the other isn't.
  2. The species hatched from a Nidoran(f) is either Nidoran(m) or Nidoran(f).
  3. The species hatched from an Illumise is either Illumise or Volbeat.
  4. If neither parent is holding a Lax Incense and the baby species would be Wynaut, the baby species is Wobbuffet instead.
  5. If neither parent is holding a Sea Incense and the baby species would be Azurill, the baby species is Marill instead.

Ability

The baby inherits the mother's ability if both species can have that ability. Otherwise, the chosen ability is random.

Moves

The baby initially has all moves it would have at level 5. The baby can inherit other moves from its parents, in this order:

  • The baby will inherit a move if the father knows it and it's an egg move for the baby's species.
  • The baby will inherit a move if the father knows it and it can be taught to the baby's species through a TM or HM.
  • The baby will inherit a move if both the mother and father know it and the baby's species could learn it by leveling up.
  • In the Emerald version, if the father is a Pikachu and holds a Light Ball and the baby is a Pichu, the baby will learn Volt Tackle.

Individual Values

The baby inherits three Individual Values corresponding to a different stat from among HP, Attack, Defense, Speed, Special Attack, and Special Defense. Each of these Individual Values is inherited from either the mother or father.

Except in the Emerald version, however, the same stat can be chosen again because the last stat chosen before is overwritten in the process of choosing three random stats.

Personality ID

Except in the Emerald version, the two low-order bytes of the baby's personality ID are never both equal to 0.

Nature

A random nature is chosen for the baby, indirectly through generation of a personality ID.

As an exception, in the Emerald version, there is a (32767/65536) chance that the baby will gain the nature of the holder of Everstone if that holder is a Ditto or the baby's mother. This case is handled by recalculating the baby's personality ID up to 2400 times until the nature is the same and the personality ID's high-order 2 bytes do not equal 0.

Please donate money and help me raise over $3100 for my education.


Discussion