Wurmple evolution bugged? What did I wrong?

Discussion in '3DS - ROM Hacking, Translations and Utilities' started by Puddies, Aug 2, 2016.

  1. Puddies
    OP

    Puddies GBAtemp Regular

    Member
    156
    32
    Jan 13, 2016
    Gambia, The
    I read that the evolution of Wurmple depends on its personality value:
    p mod 65536 = pw
    pw mod 10 < 5 then evolve to Silcoon, else evolve to Cascoon
    Source: http://bulbapedia.bulbagarden.net/wiki/Personality_value#Wurmple.27s_evolution

    I play pokemon omega ruby and I have 2 Wurmples. I looked up their personality values using pkhex.
    (I used Encryption Constant, because it is the 6th Generation)

    One with
    p = 0x41472683 = 1095181955,
    pw = p mod 65536 = 9859,
    pw mod 10 = 9 (should be Cascoon)

    The other one with
    p = 0xB7C26A86 = 3082971782
    pw = p mod 65536 = 27270
    pw mod 10 = 0 (should be Silcoon)

    But both Wurmples evolved to Silcoon. Any ideas how this can be? Why do both Wurmples evolve to Silcoon??

    I also tried this calculation with their PIDs (allthough this only matters in the 3rd Generation), but there is the same result. One should evolve to Silcoon, the other one to Cascoon.
     
    Last edited by Puddies, Aug 2, 2016
  2. KazoWAR

    KazoWAR GBAtemp Advanced Maniac

    Member
    1,818
    694
    Aug 12, 2008
    United States
    Winter Haven
    Gens 3/4 use the first 16 bits(p mod 65536), but gens 5/6 use the last 16 bits(p / 65535)
     
    Puddies likes this.
  3. Puddies
    OP

    Puddies GBAtemp Regular

    Member
    156
    32
    Jan 13, 2016
    Gambia, The
    Well ok, but I play omega ruby, this is the 6th generation. So my calculation should be correct because I used the last bits, shouldnt it?
     
  4. KazoWAR

    KazoWAR GBAtemp Advanced Maniac

    Member
    1,818
    694
    Aug 12, 2008
    United States
    Winter Haven
    you need to use p / 65536, but in your example you said you used p mod 65536
     
  5. Puddies
    OP

    Puddies GBAtemp Regular

    Member
    156
    32
    Jan 13, 2016
    Gambia, The
    Ah ok, this might be the solution. Using p / 65536 I get the values 2 and 1.
    But it is strange in the article, it says:

    "Mathematically, pw can be derived by calculatingp % 65536 for Generations III and IV or p / 65536 (rounded down) for Generation V. In Generation VI, Wurmple's evolution is now determined by the encryption constant, albeit with the same formula."

    So, only Generation V should use p / 65536, and Generation VI should use the encryption constant without any 65536 calculation ... But using this and converting it to decimal, and calculating mod 10, the results are again different evolutions (5 and 0). Very strange.
     
    Last edited by Puddies, Aug 2, 2016
  6. xirtamehtsitahw

    xirtamehtsitahw GBAtemp Regular

    Member
    131
    38
    Dec 9, 2011
    United States
    I simultaneously exist across all moments in time.
    This is one of the great Pokemon mysteries. Why on Earth did Nintendo code such a low-end Pokemon as the common Wurmple to have such a complicated evolution formula? I can figure out the math behind it, but it seems like so much work to code this type of evolutionary tactic when a simple RNG event would have been so much easier. (As in, RNG set to choose between 0 and 1. If RNG = 0, evolve into Silcoon. If 1, evolve into Cascoon).
     
  7. Puddies
    OP

    Puddies GBAtemp Regular

    Member
    156
    32
    Jan 13, 2016
    Gambia, The
    p / 65536 with p = encryption constant seems to be correct. I got a Wurmple with a value of 8 and finally it evolved to Cascoon.
    Thank you for that hint! :)
     
  8. Kaphotics

    Kaphotics badc0ded

    Member
    611
    460
    Sep 10, 2010
    United States
    smaller protip: ctrl click the legality indicator to see a verbose output.

    [​IMG]
     
    Puddies likes this.