Talk:Catch rate: Difference between revisions

Line 481: Line 481:


[[User:Xovvo|Xovvo]] ([[User talk:Xovvo|talk]]) 20:46, 23 February 2015 (UTC)
[[User:Xovvo|Xovvo]] ([[User talk:Xovvo|talk]]) 20:46, 23 February 2015 (UTC)
:Yes, they are correct, and all of these numbers are indeed taken straight from the actual code.
:Your Gen III/IV alternative formula is actually ''not'' exactly equivalent, because the square roots and divisions prior to Gen V are integer operations, i.e. they always round down: if they used the shorter version, then any ''a'' of 16 or above would actually give the same ''b'', which would be completely absurd. (255/16 gets rounded down to 15, the square root of which is rounded down to 3, the square root of which is rounded down to 1, and we end up with a ''b'' of 65535, exactly like if ''a'' were 255.) Effectively, Game Freak took the formula they wanted and multiplied by 16 both above and below the line, in order to have bigger numbers to work with in the calculation that would result in less drastic rounding errors. (There are still fairly major rounding errors, mind you; any ''a'' of 200 or above still results in a ''b'' of 65535.)
:The reason Gen V-VI use 65536 and not 65535 is that there is a tiny chance for the Pokémon not to be caught if ''b'' is 65535; presumably they ''wanted'' ''b'' to be able to be 65536 all along but originally used 65535 exactly because 65536 can't be stored in a two-byte register. In Gen V onwards they're using bigger fixed-precision numbers where they can fit 65536 in just fine anyway. [[User:Dragonfree|Dragonfree]] ([[User talk:Dragonfree|talk]]) 00:21, 24 February 2015 (UTC)
70

edits