Main Menu
Main Page
Forums
Recent changes
Random page
Help

Databases
GlitchDex
AttackDex
AreaDex
DexDex
ItemDex
MetascriptDex
TMHMDex
TrainerDex
TypeDex
UnownDex
More

Major Glitches
Trainer escape glitch
Old man glitch
Celebi Egg glitch
SRAM glitch
Buffer overflow techniques
Pomeg glitch data corruption (Glitzer Popping)
Tweaking
Pokémon cloning
Select glitches (Japan)
Time Capsule exploit
Arbitrary code execution
More

Other Glitch Categories
Glitches by generation
Japan-only/language specific glitches
Natural glitches
Non-core series glitches
Non-Pokémon glitches
Recurring glitches
More

References
Pokémon GameShark codes
Pokémon Game Genie codes
Disassembly projects
The Big HEX List
GB programming
Curiosities
Debugging features
Error traps
Non-glitch exploits
Pokémon glitch terminology
Unused content and prerelease information
More

Useful Tools
8F Helper
GBz80 to Items
Old man trick name generator
PATH (Prama's Advanced Tweaking Heaven)
Save file editors
Special stat/Pokémon converter
Trainer escape Trainer Pokémon finder

Affiliates
Legendary Star Blob 2 (Hakuda)
Pokémon Speedruns wiki
PRAMA Initiative
Become an affiliate!

Technical
Site Source Code

Search Wiki

 

Search Forums

 

Author Topic: ‘Ditto can’t use Struggle’ glitch  (Read 3941 times)

0 Members and 1 Guest are viewing this topic.

Patashu

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
‘Ditto can’t use Struggle’ glitch
« on: February 13, 2018, 12:48:58 am »
https://youtu.be/TeWxEbl2kWQ

This is a video where the uploader is documenting their attempts to beat gen 1 fighting only with a single Ditto. About half way through, their Ditto stops being able to use Struggle when they are out of Transform PP. No other Pokémon is unable to use Struggle, and transformed Ditto is also able to use struggle. The glitch wasn't fixed by depositing/withdrawing, putting Ditto in the daycare, saving/loading, or by beating the game. There is also a secondary glitch - if a 0 PP Ditto that can’t struggle is hit with Disable, the game softlocks.

I tried to find documentation on this glitch and couldn’t. Is it new or known?
« Last Edit: February 13, 2018, 05:16:22 am by Patashu »

blahpy

  • Yeah! Pomeg Berry!
  • Member+
  • *
  • Offline Offline
  • Gender: Female
    • View Profile
Re: ‘Ditto can’t use Struggle’ glitch
« Reply #1 on: February 13, 2018, 03:24:36 am »
I watched the video and also could find nothing about it online so I think it is a new discovery. Maybe struggle has a hidden pp value of 255 that isn't reset by healing or something? It also may depend on having no moves or have something to do with Transform?

jackedup05

  • GCLF Member
  • Offline Offline
  • Gender: Male
  • Puff best pokemon
    • View Profile
    • Don't have one
Re: ‘Ditto can’t use Struggle’ glitch
« Reply #2 on: February 13, 2018, 07:17:59 pm »
Maybe this just doesn't apply to ditto but every pokemon.
- Jacked_up05 ( ͡° ͜ʖ ͡°)

commy2

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: ‘Ditto can’t use Struggle’ glitch
« Reply #3 on: February 18, 2018, 04:07:30 am »
Hello :~)

Full disclaimer: I have no idea either, but these are my observations.

A hidden PP stat for Struggle seems unlikely as the move is selected automatically if the PP for all four moves are zero. There is no additional PP check to anyone's knowledge and surely the Youtuber would've run into it long before unless the maximum of that hidden PP is somehow way larger than 63 or 255.

Maybe the PP of move 2 - 4 got increased by some PP underflow glitch? Then the game would detect some PP being left in those slots when opening the movelist menu, but the player would be unable to select those moves.
The PokéCenter may only reset the PP up to encountering the first - (unoccupied) move. Maybe other healing methods (Mom/Silph CO. Bed/Lavender White Magic) could solve this?

The Youtuber would probably have remembered if he used select to switch the move order while transformed (which can glitch out the moveset of the Ditto or Mew by permanently moving glitch moves to the first position).

It's strange that this happened twice in the same area, so maybe it has to do with some Trainer's Pokémon moveset?
Ditto could use Struggle at Lv 53, but no longer at Lv  54/55, so maybe it learns a glitch move?

Random thoughts: those Jugglers are the first time the player encounters trainers that switch out their Pokémon. There're also Mirror Move Spearow and Fearow in the wild where he grinded EXP.


Disable softlocking the game is also interesting, but that might happen regardless if the PP for all moves are zero.

ISSOtm

  • The French Lord of Laziness (and a huge The Legend Of Zelda fan)
  • Staff
  • *****
  • Offline Offline
  • Gender: Male
  • Pewter City (B)rocks !
    • View Profile
    • My Little Website
Re: ‘Ditto can’t use Struggle’ glitch
« Reply #4 on: February 19, 2018, 05:36:04 am »
Crystal_ found the reason. Here's a quick summary :

  • When FIGHT is selected, the game parses all four PP slots, and if they are all zero, uses Struggle.
    Normally, an empty move's PP slot is zero, but we will see that there can be an edge case...
  • The active Pokémon is copied to a region of memory (so the game can use this instead having to constantly modify party data). For things such as HP, status, and PP, the game needs to also update the party data.
  • There is one exception to this : when a Pokémon is under Transform, the party data must not be updated. For example, PP is not subtracted from the party data.
  • When Mirror Move (or Metronome) is used, the game will decrement the PP of Mirror Move twice (once when it's actually used, and once when the move it represents is used). Thus, the game increments the PP of Mirror Move once, to compensate.
All of these make sense -- it's how the game works. But here's the catch : the "PP increment" function doesn't check for the Transformed status !

Here's how to trigger the glitch :
- Have any Pokémon with Transform (typically Ditto, but also Mew, or a Pokémon with Metronome)
- Face against a Pokémon knowing Mirror Move or Metronome

  • Transform into the Pokémon with Mirror Move;
  • Use the move;
  • The game will decrement Mirror Move's PP (but it won't because Transform);
  • (If the move fails, nothing else happens);
  • The game will increment Mirror Move's PP (thus, it will increment the PP in the corresponding slot);
  • The game will decrement Mirror Move's PP (but it won't because Transform)
Thus, the game increments a move's PP in the Pokémon's data. If the move is present, then it will just have incremented it, no biggie.

If it's not, this creates a slot that is empty, but with non-zero PP ! Thus, the game fails to use Struggle.


--

Disable
Disable first checks if there is a slot with non-zero PP, and if this fails, misses. With a Struggle-less Pokémon, this will always succeed, because of the glitched slot.
Then, Disable will attempt to pick a slot which must have a move AND non-zero PP. Assuming Transform has 0 PP, the game will never find such a slot (since the only slot with non-zero PP has no move).
Bam, infinite loop, and softlock.
"THOU SHALL NOT PASS !!"  RIVAL's effect, Gandalf.

Proudly glitching Pokémon Red and Yellow on a Black & White GB, Pocket GB, GB Color, GBA SP and new 3DS.

My Twitter (beware, I'm French)
My YouTube (same warning)

Here is an online tool to build 8F setups : GBz80 to Items !

They see me layzin', they ha-tin'...
Heavy contributor of the global augmentation of entropy (my room's is too damn high !)

Krys3000

  • The frenchie
  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • Head admin of the PRAMA Initiative
    • View Profile
    • PRAMA Initiative - Main french Pokémon glitch website
Re: ‘Ditto can’t use Struggle’ glitch
« Reply #5 on: February 19, 2018, 07:24:52 am »
That's very interesting! Thanks Crystal_ for the work, and ISSOtm for the report.

It's cool to see that we can still learn about yet another quirk that only gets discovered 20 years after the game gets released  :P

Admin of the PRAMA Initiative, the main french Pokémon glitch website
http://www.prama-initiative.com
“Anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that 'my ignorance is just as good as your knowledge.'” - Isaac Asimov

Patashu

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: ‘Ditto can’t use Struggle’ glitch
« Reply #6 on: February 19, 2018, 04:18:56 pm »
Excellent detective work!

ISSOtm

  • The French Lord of Laziness (and a huge The Legend Of Zelda fan)
  • Staff
  • *****
  • Offline Offline
  • Gender: Male
  • Pewter City (B)rocks !
    • View Profile
    • My Little Website
Re: ‘Ditto can’t use Struggle’ glitch
« Reply #7 on: February 19, 2018, 04:40:42 pm »
It's not mine, it's Crystal_'s, but thanks !
"THOU SHALL NOT PASS !!"  RIVAL's effect, Gandalf.

Proudly glitching Pokémon Red and Yellow on a Black & White GB, Pocket GB, GB Color, GBA SP and new 3DS.

My Twitter (beware, I'm French)
My YouTube (same warning)

Here is an online tool to build 8F setups : GBz80 to Items !

They see me layzin', they ha-tin'...
Heavy contributor of the global augmentation of entropy (my room's is too damn high !)