Mechanics Speed modifiers in Gens 1-4

What type of bug are you reporting? Mechanics

What is the bug?
In ADV and DPP, paralysis seems to round based on standard nearest whole number rounding, rather than always rounding down.

A paralyzed Pokemon at 299 speed should round down to 74, but since 299/4=74.75, PS will round the speed up internally to 75. The UI still displays the Pokemon's speed as 74, but it will always be faster than other Pokemon at 74 speed.

This does NOT seem to occur in BW or ORAS. I have not tested any other gens.

Are you able to replicate it? If so, how?



Although it seems clear that the Zapdos on the left should be faster, this replay https://replay.pokemonshowdown.com/gen3ou-2061656014-x4jagwixupee4gsshnousejjxcmxmq6pw shows it to be a speed tie. I think this is because 328/4 = 82, while 327/4 = 81.75, which should be rounded down to 81 (as it is in the UI), but is instead rounded up internally to the nearest whole number, 82. Thus, both Zapdos speed tie at 82 speed.





https://replay.pokemonshowdown.com/gen41v1-2061639730-ldbf888r9pimie1euzripfhwos18ftmpw

The reverse is also possible, where both Celebi should speed tie according to the UI, but one is clearly faster.
 
Can confirm that in /mods/gen4/conditions.ts, speed is modified via a chainModify(0.25) call. This uses the pokeRound function (which rounds 0.5 down, but anything above that up), rather than rounding down ("floor") always. Later gens use Math.floor(spe * 25 / 100) (or 50, when paralysis was nerfed).

I am not sure if I am reading this correctly, but what I can say for certain is that what this thread is reporting has specifically been addressed back in 2021. If I am understanding Marty's response correctly, and I think I am since DaWoblefet then edited his code to reflect it, then this seems to actually be intended Gen 4 and prior behavior.
 

DaWoblefet

Demonstrably so
is a Battle Simulator Administratoris a Community Leaderis a Programmeris a Community Contributoris a Top Researcheris a Top Tiering Contributoris a Social Media Contributor Alumnus
PS Admin
It's the opposite actually; Speed modifier application in general isn't applied in the proper order before Gen 5. When I fixed it for Gen 5+, I intentionally left the Gen 4 and prior behavior the same as it was before, due to not having full details on rounding methods used at each step in past generations. Marty provided a list, we'd just need the research on the rounding methods used when calculating Speed in generations before Gen 5.
 

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

Top