# Talk:Hidden Power (move)/Calculation

## Standards

Isn't there normally something on the discussion page that tells what about the article needs doing? Iliekmudkips 21:17, 29 September 2007 (UTC)

- Manual of style. Needs cleaning up, it's essentially a giant wall of text.
**TTEchidna**00:27, 30 September 2007 (UTC)- I'm working on a new version of this article, located here, with "/IV" and "/Type" subpages. A I am not english-native speaker, I would appreciate somebody's help, especially with math terms.Piotr mil 02:27, 22 June 2008 (UTC)
- Why not just make these pages in the main namespace? Or even better, work on them in some kind of sandbox, and
*then*put them in the main namespace? --Martonimos_{((Argh|Blargh))}02:30, 22 June 2008 (UTC)- I just want to prepare them, as I'm not sure how should they look. I was trying to make a sandbox, but it was considered as spamming and making "useless Myspace junk", so I moved here to work. Piotr mil 04:01, 22 June 2008 (UTC)
- I understand that. But when preparing them, there's no need to save the changes to the site, especially if they're not ready yet. Try copying the code to wordpad. When you want to see how it looks, copy it all, go to the sandbox, paste it in over whatever's there already, and preview it. There's no need to save.
- Like I said, I appreciate what you're doing, so I'm sorry I'm coming off as such a hard-ass here. I just want to prevent you from spamming the recent changes with a lot of edits to the same page. --Martonimos
_{((Argh|Blargh))}05:32, 22 June 2008 (UTC)- That's ok. I hope you appreciate the article. Piotr mil 16:33, 27 June 2008 (UTC)

- I just want to prepare them, as I'm not sure how should they look. I was trying to make a sandbox, but it was considered as spamming and making "useless Myspace junk", so I moved here to work. Piotr mil 04:01, 22 June 2008 (UTC)

- Why not just make these pages in the main namespace? Or even better, work on them in some kind of sandbox, and

- I'm working on a new version of this article, located here, with "/IV" and "/Type" subpages. A I am not english-native speaker, I would appreciate somebody's help, especially with math terms.Piotr mil 02:27, 22 June 2008 (UTC)

I'm not sure if I understand this correctly, but can't you change the type and power of Hidden Power by evolution? Silvaze363 20:31, 30 June 2011 (UTC)

## Maths

Can't the calculations and explanations for the Hidden Power formula be easier? I'm not good at maths, and I don't think many people here are Math professors.FireHazard 02:24, 24 August 2008 (UTC)

- No, that equation is simplified as far as it could possibly go.
02:25, 24 August 2008 (UTC)^{Moldy}_{Orange}- Its actually quite simpleGood Day;DCM

- Math professors??? Multiplying, adding and dividing is a basic knowledge. You don;t need to have four brains or be able to bend spoons to understand it. I know, however, that this might be a little bit confusing when you look at this for the first time, but - again - try to do some math excercises, and you will understand it. Pokémon games are based on math (shinyness, game data structures, IVs, EVs, etc.) like everything else. And - yes - I simplified this article to the maximum. The previous one was quite messy. Piotr mil 12:11, 13 September 2008 (UTC)
- I added a few links to Wikipedia math articles to make the article a little bit easier to understand. Hopefully I won't be punished for too many wp: likns :D Piotr mil 12:23, 13 September 2008 (UTC)

The HP image for gen 2 is wrong since the formula should show HP type = **4** (a mod 4) + (b mod 4). It's missleading. Joim (talk)

- Ah, good catch. Fixed. (Note that the image may be cached and not update instantly.) --
**Snorlax****Monster**15:49, 7 May 2013 (UTC)

## GEN II

How Did It Work In Generation Two? TorchicBlaziken ^{(talk•edits)} 12:47, 21 December 2008 (UTC)

I'm pretty sure it worked the same way it's listed here now.--jw 13:08, 14 February 2009 (UTC)

Is there any particular reason why it wouldnt have worked the same way in Gen II, TorchicBlaziken? --sHoggard - rookie Pokéwiz 21:21, 9 August 2010 (UTC)

Yes, there is. In Generation II the special attack and special defense share the same IV (for backwards compatibility with Gen I) and the IV for HP is derived from the other IVs. In short: the IV system in Generation II is different from later Generations. --Tai Ferret 20:43, 14 December 2010 (UTC)

## Bits?

I feel like there should be an illustration of the reasons behind this seemingly complex calculation involving remainders, that reason being the binary representation of the IVs. I was thinking something along the lines of this (using the pikachu's stats in the example)

Relative bit weights | |||||||||
---|---|---|---|---|---|---|---|---|---|

MSB | DisableAbility | IsEgg | Sp. Def | Sp. Atk | Speed | Defense | Attack | HP | LSB |

0 | 0 | 11111 | 11110 | 11111 | 11111 | 11111 | 11110 |

111111 = 63

101110 = 46

--Null Set 02:42, 11 November 2009 (UTC)

- The way I sure the games do it, is for the type, each variable equals the last bit in its IV and, for the Power, each Variable equals the second to last bit. I just put it a section below this one. It is concerned with the possible outcomes of Hidden Power but it makes mention to what you're getting at.The Professor 20:31, 25 June 2010 (UTC)

## Possible HP Combos

The Section about the number of possible Hidden Power combinations is not entirely correct. The section says that since there are 32 possible values for each IV, the number of possible combinations is 32^6. If you get down to purely what the outcome is, then there are only 4^6 combinations. If you graph the outcomes for for the possible numbers this is what you get.

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | |

Type | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 |

Power | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 |

There are four possible out comes for each IV Value; 00, 01, 10 and, 11. For any one who doesn't know binary these values equal the numbers 0, 1, 2 and, 3. Basically, you take the binary version of the IV and look at the last two bits to get the the outcome. This means that even though each IV is a number 0-31, the outcome boils down to a number 0-3. So there are 4 significant values for each IV, and there are 6 IV's so there are 4^6 (2^12) combinations for Hidden Power. That comes out to be 4096 possible outcomes. Far less than this article's stated 32^6(1073741824) outcomes. For any one who is confused about all of this I can explain it in further detail. Tell me watcha think! The Professor 20:21, 25 June 2010 (UTC)

- Uhmm.... I'm not sure, if you have read the article correctly. I wrote the bit about 32^6 and wrote it's
**far too big**... and then I wrote about 4^6....So.... I really don't get, what's your point, you have just copied the article here -__- Piotr mil 12:05, 20 July 2010 (UTC)

## Really, divided out of 15?

It seems kind of stupid that the game developers would do such an uneven job of distributing Hidden Power. Simply dividing it by 4 gives a perfectly uniform distribution. Are you sure that the way it is now is correct? Ztobor 03:42, 23 July 2010 (UTC)

## These are... well wrong

These are wrong, actually. This what you get for borrowing from Serebii, he doesn't fact check, he just tries to get stuff up fast, regardless of accuracy.

Ask the people in PP chat, and they can usually give you the real stuff.

These are the algorithms as from the game themselves.

//These are unfinished methods to calculate the HiddenPower type and attack power. uint8_t getHiddenPowerType(int iv_hp, int iv_atk, int iv_def, int iv_spd, int iv_satk, int iv_sdef) const { uint8_t a = ((iv_hp & 1) << 0); uint8_t b = ((iv_atk & 1) << 1); uint8_t c = ((iv_def & 1) << 2); uint8_t d = ((iv_spd & 1) << 3); uint8_t e = ((iv_satk & 1) << 4); uint8_t f = ((iv_sdef & 1) << 5); //This is equivalent to (a + b + c + d + e + f) / 4, but this is actually much faster. (division is SLOW) -- Chase return (a + b + c + d + e + f) >> 2; } uint8_t getHiddenPowerAttack(int iv_hp, int iv_atk, int iv_def, int iv_spd, int iv_satk, int iv_sdef) const { //Warning, these are NOT the same as the ones in the last function. uint8_t a = ((iv_hp & 2) >> 1); uint8_t b = ((iv_atk & 2) << 0); uint8_t c = ((iv_def & 2) << 1); uint8_t d = ((iv_spd & 2) << 2); uint8_t e = ((iv_satk & 2) << 3); uint8_t f = ((iv_sdef & 2) << 4); //This is very similar to ((1 + a + b + c + d + e + f)*6250)/10000 + 30, however much faster. (division is SLOW) -- Chase return (((1 + a + b + c + d + e + f) * 10) >> 4) + 30; }

Fxblaster 01:36, 1 January 2011 (UTC)

Actually those are large and over complicated, something as simple as these two do the job exactly the same.

int type = (iv_def & 1) + ((iv_spd & 1) << 1) + ((iv_satk & 1) << 2) + ((iv_sdef & 1) << 3); int power = (((((iv_sdef&2)<<1) + (iv_satk&2) + ((iv_spd&2)>>>1))*10 + (iv_def&2)*3 + (iv_hp&2) + (iv_atk&2)) >>> 1)+30;

Chase 05:17, 1 January 2011 (UTC)

- Yeah, those formulas were completely wrong. I added working ones (I'm still not sure about the base power calculation, but type checks out at least), though they're a bit ugly. HyperHacker (talk) 06:32, 26 April 2013 (UTC)
- I fixed your base power formula. I notice, however, that the formulae here are contradicted by UPC, Smogon, Psypoke's calculator, Legendary Pokemon's calculator, game-capture.cc's calculator, and Pokemon Republic's calculator, all of which use the previously given formulae. Given that I now have six different sources, two of which are Japanese, I think someone should check this in experiment in all generations, just to make sure. Arcorann (talk) 07:21, 26 April 2013 (UTC)
- I'm actually still not sure the type calculation is right either. Someone would have to compare to actual save data. HyperHacker (talk) 08:00, 26 April 2013 (UTC)
- Nope. Extracted the IVs from a save file and compared... the current formula sometimes gives type indexes one too high. I wonder if that has to do with rounding, but modulo doesn't give any decimal part, so it's strange... I guess someone would have to look into the code to see what exactly is up. HyperHacker (talk) 06:04, 28 April 2013 (UTC)
- The behaviour you saw is consistent with the old formula. I just tested myself on FireRed, an Unown with IVs HP/Atk/Def/Spd/SpA/SpD 13/25/5/15/10/2 was super effective on a Fire-type, which is consistent with the old formula as against this one. Until someone can confirm that this formula is actually used in anything, I am reverting to the old formulae for now. Incidentally, which version did you check? Arcorann (talk) 07:19, 28 April 2013 (UTC)

- Nope. Extracted the IVs from a save file and compared... the current formula sometimes gives type indexes one too high. I wonder if that has to do with rounding, but modulo doesn't give any decimal part, so it's strange... I guess someone would have to look into the code to see what exactly is up. HyperHacker (talk) 06:04, 28 April 2013 (UTC)

- I'm actually still not sure the type calculation is right either. Someone would have to compare to actual save data. HyperHacker (talk) 08:00, 26 April 2013 (UTC)

- I fixed your base power formula. I notice, however, that the formulae here are contradicted by UPC, Smogon, Psypoke's calculator, Legendary Pokemon's calculator, game-capture.cc's calculator, and Pokemon Republic's calculator, all of which use the previously given formulae. Given that I now have six different sources, two of which are Japanese, I think someone should check this in experiment in all generations, just to make sure. Arcorann (talk) 07:21, 26 April 2013 (UTC)

## Formula simplifying

instead of multiplying by 15 and dividing by 63, why not just multiple by 5 and divide by 21? You'll still get the same answer. JDDJS 20:35, 14 December 2011 (UTC)

## "it is not forbidden, just statistically impossible. "

this statement doesn't make any sense. If it's impossible, then it's forbidden. Jmvb 17:16, 24 January 2012 (UTC)

## Generation II

Does anyone have an idea how this is calculated in Generation II? --**Snorlax****Monster** 14:16, 21 November 2012 (UTC)

- Check this out.UltimateSupreme([email protected]) 16:01, 21 November 2012 (UTC)

## Gen VI

Wouldn't this method change for Gen VI, due to the new Fairy type, and the necessity for adding a 17th value for Type. Xolotl (talk) 14:18, 2 August 2013 (UTC)

## G5

So I have this Samurott with IVs of 25/30/30/28/18/6

I've checked type and it's Fighting (since it was super-effective on Bouffalant).

With our calculations

Floor[(1 + 0 + 0 + 0 +0 + 0)*15/63] = Floor[1*15/63] = Floor[0.23809523809] = 0

Type calculation seems correct. Can't really check the BP, though. Marked +-+-+ (talk) 16:09, 2 August 2013 (UTC)

- We're trying to falsify the formula given earlier on the page, which for this value gives the same answer (Floor(1/4) = 0), so this doesn't really help. Do you have any other results? Arcorann (talk) 03:45, 27 October 2013 (UTC)

## simplification/clean up?

Is there any way under Arceus' yellow sun we can simplify this page; Not the math, but the info and how its presented? It just seems to be a bunch of crap (pardon my brashness) dressed up to make it look smart, and that the article is going the long way around just to get a short distance to the goal. You can cut a barbie doll's hair and put her in Ken's clothes, but she's still Barbie Millicent Roberts, not Ken Carson. Is all the stuff on this article really necessary; couldn't we at the very least make a bare to the bones, simple and to the point section? Yamitora1 (talk) 23:09, 16 March 2014 (UTC)

## Table of values

For what it's worth, I wrote up a table mapping IV bits to the resulting type and power of Hidden Power since Generation III:

https://drive.google.com/file/d/0Bx0D0JuEJH2NTHlZc0VQcU1BWFU/view?usp=sharing

- Andrio Celos (talk) 11:46, 15 April 2017 (UTC)

## why

why are you using Cosplay Pikachu for Hidden Power's damage calculation when the base power is always 60 in the only 2 games you can find Cosplay Pikachu? Pikachu210 (talk) 18:12, 15 October 2019 (UTC)

## gen 2 calculation (mod 4)

in gen two's section it says modulo 4 for the attack, defense and special ivs wouldn't that just be the least 2 significant bits or am I missing something Wild Starfish (talk) 15:44, 21 March 2020 (UTC)

- Modulo 4 is equivalent to taking the two least significant bits. --
**Snorlax****Monster**00:51, 22 March 2020 (UTC)

## gen 2 calculation (power)

do all powers have the same distrubution in these games it should be noted either way Wild Starfish (talk) 15:44, 21 March 2020 (UTC)

- The distribution of the different powers are detailed in the section Percentage distribution of different variations of Hidden Power. --
**Snorlax****Monster**00:52, 22 March 2020 (UTC)- that's for gen 3 and onwards if you looked at this sections title you'd know I meant gen 2 specifically Wild Starfish (talk) 05:09, 23 March 2020 (UTC)