1. The moderators of this forum are Jellicent and Lutra.
  2. Welcome to Smogon Forums! Please take a minute to read the rules.
  3. Click here to ensure that you never miss a new SmogonU video upload!

All Gens Past Gens Research Thread

Discussion in 'Ruins of Alph' started by Jellicent, May 15, 2014.

  1. Jorgen

    Jorgen World's Strongest Fairy
    is a Forum Moderator Alumnusis a Community Contributor Alumnusis a Contributor Alumnusis a Past SPL Champion

    Joined:
    Jun 5, 2010
    Messages:
    1,611
    Could you eat a Hyper Beam, freeze a mon, then subsequently overwrite the Freeze with Sleep?

    Is Sleep the only status the Hyper Beam glitch works for?

    Holy shit you're on fire Crystal_
    xJoelituh likes this.
  2. dekzeh

    dekzeh B is for BRUTUS
    is a Tournament Director Alumnusis a Forum Moderator Alumnusis a Past WCoP Champion

    Joined:
    Jul 13, 2007
    Messages:
    953
    Can you fucking stop ruining this metagame we have played for over 10 years?!

    >:(
    Zowayix, Vinc2612 and xJoelituh like this.
  3. froggy25

    froggy25 Bye RNGmon
    is a Pokemon Researcher

    Joined:
    Dec 31, 2006
    Messages:
    391
    You're my hero Crystal !

    Hyper Beam + Sleeping move works on Stadium too.
    I can also confirm no Paraslam on Normal-types on Stadium, I'll add it on datacrystal if anyone is interested.
    xJoelituh, Disaster Area and Crystal_ like this.
  4. Crystal_

    Crystal_
    is a Pokemon Researcheris a Contributor Alumnusis a Smogon Media Contributor Alumnusis a Past SPL Champion

    Joined:
    Dec 20, 2009
    Messages:
    1,155
    Yeah, haven't thought of that possibility. It requires a speed tie and first the Hyper Beam user going first, then going second in the next turn, right?

    Yep.

    I'm enjoying this so much! I won't stop until Golbat and Butterfree are somehow the best Pokemon in the metagame.
  5. Mr.E

    Mr.E im the best
    is a Pre-Contributoris a Past SPL Champion

    Joined:
    Dec 29, 2004
    Messages:
    5,038
    10 years? nigga pls

    I mean yeah, it's over ten years kinda like how it's over one years...
    Aurora and NixHex like this.
  6. Joim

    Joim Pixels matter
    is a Site Staff Alumnusis a Battle Server Admin Alumnusis a Programmer Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus

    Joined:
    Oct 9, 2012
    Messages:
    3,524
    Ok, I've implemented the hyper beam recharge bug so you can now put to sleep any statused mon on its recharge turn:
    https://github.com/Zarel/Pokemon-Showdown/commit/b5f04be35042c717b59d82b3658853a04622d50f

    test (open)

    Turn 1
    Gengar, come back!
    Go! Exeggutor!
    The opposing Persian used Bubble Beam!
    It's not very effective... Exeggutor lost 4.3% of its health!
    Turn 2
    >>> p1active
    <<< p1a: Persian
    >>> p1active.setStatus('psn')
    The opposing Persian was poisoned!
    <<< true
    The opposing Persian used Bubble Beam!
    It's not very effective... Exeggutor lost 4.3% of its health!
    The opposing Persian was hurt by poison!
    Exeggutor used Sleep Powder!
    Exeggutor's attack missed!
    Turn 3
    The opposing Persian used Bubble Beam!
    It's not very effective... Exeggutor lost 4.1% of its health!
    The opposing Persian was hurt by poison!
    Exeggutor used Sleep Powder!
    But it failed!
    Turn 4
    The opposing Persian used Hyper Beam!
    Exeggutor lost 39.7% of its health!
    The opposing Persian was hurt by poison!
    Exeggutor used Sleep Powder!
    The opposing Persian fell asleep!


    Enjoy :D
  7. froggy25

    froggy25 Bye RNGmon
    is a Pokemon Researcher

    Joined:
    Dec 31, 2006
    Messages:
    391
  8. Joim

    Joim Pixels matter
    is a Site Staff Alumnusis a Battle Server Admin Alumnusis a Programmer Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus

    Joined:
    Oct 9, 2012
    Messages:
    3,524
    Disaster Area, Crystal_ and froggy25 like this.
  9. froggy25

    froggy25 Bye RNGmon
    is a Pokemon Researcher

    Joined:
    Dec 31, 2006
    Messages:
    391
  10. Joim

    Joim Pixels matter
    is a Site Staff Alumnusis a Battle Server Admin Alumnusis a Programmer Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus

    Joined:
    Oct 9, 2012
    Messages:
    3,524
    Quick questions:
    1. Sand Attack was normal on gen 1, right? It's listed as ground move on Smogon but I think that's wrong.
    2. Stadium was bring 3 use 3? I recall it being so and not bring 6 choose 3.
  11. Millky95

    Millky95

    Joined:
    Aug 7, 2013
    Messages:
    527
    Stadium depended on what rules you played by. All 4 of the main cups an gym Leader Castle were Bring 6 choose 3
  12. froggy25

    froggy25 Bye RNGmon
    is a Pokemon Researcher

    Joined:
    Dec 31, 2006
    Messages:
    391
    1. Sand-Attack is Normal in gen 1. It hits Ghosts, type is ignored.
    2. Stadium is bring 6, use 3 in Stadium Cups and Gym Leaders Castle. In human vs human battles you can use 6vs6 if you want.

    If you plan to implement Stadium in Pokémon Showdown, I'm currently looking at Critical Hit mechanics as they work a bit differently than in RBY.
    Critical Hits are slightly less frequent, and Focus Energy does not exactly multiply Critical Hits by 4.
  13. Joim

    Joim Pixels matter
    is a Site Staff Alumnusis a Battle Server Admin Alumnusis a Programmer Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus

    Joined:
    Oct 9, 2012
    Messages:
    3,524
    Yeah, the way I've implemented it is that I inverte the focus energy check (as was probably intended on gen 1), making focus energy make the crits as often as on gen 1 and without it quarter as often.

    I'm wondering whether to put stadium on 6v6 or bring 6 use 3. You know, to make a cool difference between rby and stadium.
  14. froggy25

    froggy25 Bye RNGmon
    is a Pokemon Researcher

    Joined:
    Dec 31, 2006
    Messages:
    391
    It's weirder than that.
    Jolteon for example has:
    • 130/512 in RBY
    • 102/512 in Stadium
    • 364/512 w/ Focus Energy on Stadium
    I'm still trying to figure exactly how the Critical Hit Ratio is calculated, but I'm sure about those probabilities.

    Also, there's no 1/256 misses for 100% Accuracy moves in Stadium.
  15. Joim

    Joim Pixels matter
    is a Site Staff Alumnusis a Battle Server Admin Alumnusis a Programmer Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus

    Joined:
    Oct 9, 2012
    Messages:
    3,524
    Yeah I already got the 1/256 thing. I'm intrigued on critical hit calculation, though. The actual cartridge game calculates it over 256 (0-255), where Jolteon has 65/256 or 130/512, so 102/512 should be 51/256.

    To get 51/256, given the calculation works as gen 1:
    critrate = floor((floor(basespeed / x) * x) / x)
    For base speed = 130, x can be: [2.51, 2.53]
    But decimals don't make much sense, it must be a division by 100 with flooring applied. So we try this:
    critrate = floor((floor(basespeed / x * 100) * x / 100) / x * 100)
    and we get [246, 249], when it would make sense for it to be 255, which gives us a 49/256 or 98/512.

    Now, going on what I find on the internet (which is prone to not to be 100% accurate), I get this:
    CH% rate = (User's base Speed) * 100 / 128, which gives us 101/512, rounded down.

    Following this formula, to achieve the 364/512 or 157/256 with focus energy on Stadium, focus energy should work such as: basespeed * 100 / 36, which gives us, floored, 361/512 or 180.5/256 (180). Which looks pretty arbitrary, to be honest. Dividing by 32, which is 128 / 4 (the four times from focus energy) gives us 406/512 or 203/256, which looks slightly high but makes sense, don't you think so? And that would make high crit rate moves to work by dividing by 64, double the changes as the original / 128.

    Edit: Checking the ROM hack page.
    Relevant

    Last edited: Jan 8, 2015
  16. froggy25

    froggy25 Bye RNGmon
    is a Pokemon Researcher

    Joined:
    Dec 31, 2006
    Messages:
    391
    Note that the Stadium quickfix inherently gives all non-100% accuracy move an additional 1/256 accuracy.
    Hypnosis which has an accuracy of 153 hits if PRN < 153, or if PRN == 255
    If you want to implement accuracy / 256 one day
    Last edited: Jan 8, 2015
  17. froggy25

    froggy25 Bye RNGmon
    is a Pokemon Researcher

    Joined:
    Dec 31, 2006
    Messages:
    391
    Edit: the game does Base Speed + 76 >> 2, see next posts

    Unfortunately, it's really 182/256. I'm still looking into it atm.
    As you can see on this printscreen, Stadium checks if the 1-byte PRN is lower than the adjusted CH Ratio. For Jolteon, the CH Ratio w/ Focus Energy is 0xB6, which is 182/256.
    Without Focus Energy it is 0x33, which is 51/256.

    Attached Files:

    Last edited: Jan 8, 2015
  18. Joim

    Joim Pixels matter
    is a Site Staff Alumnusis a Battle Server Admin Alumnusis a Programmer Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus

    Joined:
    Oct 9, 2012
    Messages:
    3,524
    Sorry, I edited my previous post in, but now I see it, it seems that the game checks for focus energy first and then critical hit ratio? Damn, this is hard to read, having to check the MIPS instruction reference all the time, lol.

    BEQ T2, R0, $0035C598 // If Focus Energy is not active, jump to 0x35C598
    ---- executed if focus energy -----
    ADDIU A2, R0, $0004
    SLL V1, V1, $2 // Adjusted CH Ratio × 4 // This is a shift left logical. So V1, critical hit rate, = V1 << $2
    BEQ R0, R0, $0035C59C // Jump to 0x35C59C // A Branch On Equal
    ADDIU V1, V1, $00A0 // Add immediate unsigned, no overflow (v1 = v1 + $00A0). 0xA0 is 160.
    ----- end execution if focus energy ----
    (0x35C598) SLL V1, V1, $1 // Shift left logical, V1 << $1
    (0x35C59C) LBU A0, $0044 (V0) // Load Move ID in A0

    So then it jumps to critical hit ratio calculation from the move.
  19. froggy25

    froggy25 Bye RNGmon
    is a Pokemon Researcher

    Joined:
    Dec 31, 2006
    Messages:
    391
    I'm sorry about the really bad formatting, LemASM only lets me copy one line at a time without the address, as I couldn't find a "save MIPS" button or something like that >_<
    If there is a more practical way, please tell me as I'm still a newbie at N64 MIPS !
  20. Joim

    Joim Pixels matter
    is a Site Staff Alumnusis a Battle Server Admin Alumnusis a Programmer Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus

    Joined:
    Oct 9, 2012
    Messages:
    3,524
    Yeah, don't worry, I have 0 idea on MIPS; I need to read the instructions with the manual to find the stuff out. Right now I'm reading it I don't really get as I see it's shifting left and right by 1 all the time and a couple of >> 2 and << 2. I don't know if the code on the page is exactly ordered...

    On "Determines if the attack is a Critical Hit"
    BNE A1, A0, $0035C52C (goto 0x35C52C)
    Loads crit ratio, adds 4C (76) to it, if greater than 0, ratio >> 2 ( /= 4).
    Start 0x35C52C
    Loads crit ratio, ratio >> 1 ( /= 2)
    BEQ T2, R0, $0035C598 // If Focus Energy is not active, goto to 0x35C598
    ratio << 2 ( *= 4)
    BEQ R0, R0, $0035C59C // goto to 0x35C59C
    ADDIU V1, V1, $00A0
    Start 0x35C598
    ratio << 1 ( *= 2)
    Start 0x35C59C
    LBU A0, $0044 (V0) // Load Move ID in A0
    JAL $0436FD54 // Jump to 0x35A614 (Checks if the Move has a High Critical Hit Rate)

    Seems that focus energy does << 2 and non focus energy does << 1? Then 0x35A614 has a test for the move data to see its crit rate, and then on the crit rate calc there's a bunch of >> 1 and << 1. And a some other shifts of 2.
    Last edited: Jan 8, 2015
  21. Joim

    Joim Pixels matter
    is a Site Staff Alumnusis a Battle Server Admin Alumnusis a Programmer Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus

    Joined:
    Oct 9, 2012
    Messages:
    3,524
    Wait, wait, wait:
    Base speed 130
    Add 76 to it -> 206>
    206 >> 1
    (130 + 76) >> 1 = 103
    103 >> 1 = 51

    Reading again 0x35C4D8 - Determines if the attack is a Critical Hit

    BNE A1, A0, $0035C52C
    SB R0, $4DA5 (AT)
    LUI V0, $843C
    LW V0, $5238 (V0)
    LUI V1, $8007
    LBU T6, $000B (V0)
    SLL T7, T6, $2
    SUBU T7, T7, T6
    SLL T7, T7, $3
    SUBU T7, T7, T6
    ADDU V1, V1, T7
    LBU V1, $0F8D (V1) // Loads CH Ratio
    ADDIU V1, V1, $004C // ratio + 76
    BEQ R0, R0, $0035C558 // Jump to 0x35C558 if R0
    SRA V1, V1, $2 // ratio >> 2

    This gets us (130 + 76) >> 2 which is 51 which is regular crit ratio.
    Crystal_ and froggy25 like this.
  22. froggy25

    froggy25 Bye RNGmon
    is a Pokemon Researcher

    Joined:
    Dec 31, 2006
    Messages:
    391
    Last edited: Jan 8, 2015
    Crystal_ and Joim like this.
  23. Joim

    Joim Pixels matter
    is a Site Staff Alumnusis a Battle Server Admin Alumnusis a Programmer Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus

    Joined:
    Oct 9, 2012
    Messages:
    3,524
    Haha, you ninja'd me on the focus energy, was reading the code more carefully in the train and saw you already has posted it.

    Well, tomorrow I'm adding the stadium challenge option :P
    xJoelituh and froggy25 like this.
  24. froggy25

    froggy25 Bye RNGmon
    is a Pokemon Researcher

    Joined:
    Dec 31, 2006
    Messages:
    391
    Last edited: Jan 8, 2015
    Joim likes this.
  25. Disaster Area

    Disaster Area formerly Piexplode

    Joined:
    Oct 26, 2013
    Messages:
    1,861
    Crystal_ I noticed you failed to mention the other glitch you found on the paraslam day in here, about the speed boost/drop stuff whilst statused. Could you post that here? I'm not sure if it's been coded into the sim yet either - would have mattered in a game I just played versus a friend (would have abused the hbeam+sleep glitch too but he bslammed 3rd time in tauros ditto on my victreebel :[)

Users Viewing Thread (Users: 0, Guests: 0)