User:Chenzw/Encryption constant

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
Bulbapedia bulb.png This article is intended to be moved into one of Bulbapedia's main content spaces.
Be mindful that it is still part of a personal userspace. Any content changes should be brought up on the talk page for this article.

A Pokémon's encryption constant is an unsigned 32-bit integer that is created when the Pokémon is first generated by the game. As an unsigned 32-bit integer, its value can be anywhere from 0 (32 zeroes in binary) to 4,294,967,295 (32 ones in binary), inclusive. This value was introduced in Generation VI.

The encryption constant is located in the first four bytes of the Pokémon's 232*-byte structure. It also now determines some of a Pokémon's properties that were previously determined by the personality value.

Pokémon transferred to Generation VI via Poké Transporter will have an encryption constant that is equal to its personality value.

Usage

Encryption

See also: Pokémon data structure in Generation IV#Encryption

In Generation VI, the encryption constant seeds the pseudorandom number generator (PRNG) during decryption of the Pokémon's data structure. In Generation IV and Generation V, this role was originally taken up by the Pokémon's data structure's checksum.

Characteristic

From Generation IV onward, Pokémon have a Characteristic which indicates their highest IV. In the case of a tie, the encryption constant is used to determine which stat wins the tie.

The tie-breaker starts at the stat with the index p % 6 and increments the index (returning to 0 after reaching 5) if it is not one of the stats that is tied for highest. The first stat checked that is tied for highest wins the tie and will determine the Characteristic.

p % 6 Stat
0 HP
1 Attack
2 Defense
3 Speed
4 Special Attack
5 Special Defense

Spinda's spots

00000000 00000000 00000000 00000000

Spinda has four spots: two on its face, and one on each of its ears.

Each byte in the encryption constant represents the coordinates of one of these spots. The x-coordinate is the lower four bits of the byte and the y-coordinate is the higher four bits of the byte. These coordinates determine the position of the top-left corner of the corresponding spot.

While this would appear to mean that Spinda's spots have as many possible variations as there are possible values of the encryption constant (4,294,967,296), some coordinates will place a spot off of Spinda's body or such that one wholly overlaps another. Therefore, in practice, the number of observed variations is fewer.

Wurmple's evolution

00000000 00000000 00000000 00000000

Wurmple's evolution is determined by the upper half (highlighted in red above), referred to here as pw. Mathematically, pw can be derived by calculating p / 65536 (rounded down).

If the result of pw % 10 is less than 5, Wurmple will evolve into Silcoon. If it is greater than or equal to 5, Wurmple will evolve into Cascoon.

Maushold's form

Maushold has two different forms: Family of Four and Family of Three. The form Tandemaus evolves into is determined based on its encryption constant (an extension of the personality value), with a 1/100 chance of evolving into the Family of Three form. This is not the case for wild Maushold in Tera Raid Battles, which have a form determined by the raid's difficulty rating (Family of Three for 4★ or Family of Four for 6★) regardless of their encryption constant value.

If the is 0, the result is the Family of Three form. Any other result yields the Family of Four form.

Dudunsparce's form

Dudunsparce has two different forms: the Two-Segment Form and the Three-Segment Form. The form Dunsparce evolves into is determined based on its encryption constant (an extension of the personality value), with a 1/100 chance of becoming Three-Segment Form. This is not the case for wild Dudunsparce, which are always in Two-Segment Form regardless of their encryption constant value.

If the is 0, the resulting is Three-Segment Form. Any other result yields Two-Segment Form.

See also