Main Menu
Main Page
Forums
Recent changes
Random page
Help

Databases
GlitchDex
AttackDex
ItemDex
TrainerDex
TypeDex
UnownDex
More

Major Glitches
Trainer escape glitch
Old man trick
Celebi trick
Select glitches (Japan)
SRAM glitch
CoolTrainer♀ corruption
LOL glitch
Rival LOL glitch
Super Glitch
ZZAZZ glitch
Pomeg corruption glitch (Glitzer Popping)
Tweaking
Elite Four door glitch (Japan)
Pokémon merge glitch
Pokémon cloning
Time Capsule exploit
Arbitrary code execution
Coin Case glitch
More

Other Glitch Categories
Glitches by generation
Glitches between two generations
Japan-only/language specific glitches
Music glitches
Natural glitches
Non-core series glitches
Non-Pokémon glitches
Officially acknowledged glitches
Recurring glitches
Dead glitches

References
Pokémon GameShark codes
The Big HEX List
GB programming
Curiosities
Debugging features
Easter eggs
Error traps
Glitch areas
Glitch myths
Non-glitch exploits
Placeholder texts
Pokémon glitch terminology
Unused content and prerelease information

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!

Search Wiki

 

Search Forums

 

Author Topic: What Are The Reasons Behind The Merge Glitch?  (Read 771 times)

0 Members and 1 Guest are viewing this topic.

rinlingyo2016

  • GCLF Member
  • Offline Offline
  • i find this stuff fascinating
    • View Profile
What Are The Reasons Behind The Merge Glitch?
« on: February 13, 2017, 07:29:31 pm »
Do we know why the merge glitch works? (http://glitchcity.info/wiki/Pok%C3%A9mon_merge_glitch) Does it have to do with how glitch pokemon with an index number of 255 (e.g. Charizard 'M) are read as a "stop" command? (venturebeat.com/2011/12/07/the-7-freakiest-pokemon-redblueyellow-glitches/ see section "Charizard 'M")
Any thoughts are appreciated. Thanks!

Yeniaul

  • Guest
Re: What Are The Reasons Behind The Merge Glitch?
« Reply #1 on: February 13, 2017, 09:25:49 pm »
The answer is most likely YES. I bet ISSOtm or Torchickens can and will clarify, though.

Unused Trainer

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: What Are The Reasons Behind The Merge Glitch?
« Reply #2 on: February 14, 2017, 06:07:21 am »
Yes this is a very good question.

Torchickens

  • Administrator
  • *****
  • Offline Offline
  • Gender: Female
    • View Profile
Re: What Are The Reasons Behind The Merge Glitch?
« Reply #3 on: February 14, 2017, 10:47:23 am »
Do we know why the merge glitch works? (http://glitchcity.info/wiki/Pok%C3%A9mon_merge_glitch) Does it have to do with how glitch pokemon with an index number of 255 (e.g. Charizard 'M) are read as a "stop" command? (venturebeat.com/2011/12/07/the-7-freakiest-pokemon-redblueyellow-glitches/ see section "Charizard 'M")
Any thoughts are appreciated. Thanks!

The answer is most likely YES. I bet ISSOtm or Torchickens can and will clarify, though.

Yeah, I think the roots of the Pokémon merge glitch are similar to item stack duplication glitch (http://glitchcity.info/wiki/Item_stack_duplication_glitch). I haven't taken a look at the routines involved but know this shifting occurs in multiple glitches like remaining HP glitch and other box data shift glitches, bad clone glitch.

The game encounters an FF and shifts back all the data before it.

Consider you have the stored Pokémon:

Bulbasaur
Pidgey
Cancel

;and the structure (http://datacrystal.romhacking.net/wiki/Pok%C3%A9mon_Red/Blue:RAM_map#Stored_Pok.C3.A9mon) of the stored Pokémon list goes like: Pokémon 1, Pokémon 2 (... Pokémon 20).

Bulbasaur is the first Pokémon so withdrawing it causes the shifting to occur. Pokémon 2 becomes Pokémon 1 and Pokémon 2 becomes Cancel.

It seems the problem is related to when you perform the Pokémon merge glitch you are withdrawing above a FF, which is considered as a Cancel and causes problems due to how the game shifts bytes before it.

(e.g. in

Bulbasaur
Cancel
Mewtwo
Pidgey

We withdraw Bulbasaur and Mewtwo hybridizes with FF/Cancel and Pidgey hybridizes with Mewtwo.)
Hello. I actually identify as gender questioning, but nowadays feel more firmly that I identify as female. My sex is male but I like to express myself as female.  She/her pronouns, please.


Thank you Aeriixion for the cute sprite above! :) Roelof also made different variations of the sprite (which I animated).

Contact:

Email Youtube Twitter
Skype: Torchickens
Bulbapedia Starfy Wiki

Beyond all philosophies are the things that go best for you; what makes you feel content. It's important to always follow your heart, so unless you feel perfectly happy about it don't just follow something because it is popular, fits a style or is conventional. Sometimes you may reach a point you're not sure who you are, but as things settle I'm convinced things do work out in time.

ISSOtm

  • The French Lord of Laziness (and a huge The Legend Of Zelda fan)
  • Wiki Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Pewter City (B)rocks !
    • View Profile
    • My Little Website
Re: What Are The Reasons Behind The Merge Glitch?
« Reply #4 on: February 15, 2017, 09:08:30 am »
You are right when you say "this comes from $FF meaning STOP to the game".
Basically, the game has two separate lists for boxed Pokémon. A list of IDs (identifying which Pokémon is in which slot) and a list of data (saving each Pokémon's data, including another ID byte as well as EVs, stats, attacks and other stuff you may or not witness on the STATS screen.
The problem is the way the game handles withdrawing a Pokémon. Here it is in pseudo-code :

1. Decrement the number of Pokémon in the box
2. Start at the ID of the withdrawn Pokémon
2.1. Copy the following ID to the current ID
2.2. Move forwards 1 ID
2.3. Repeat unless we copied $FF (usually what "terminates" the ID list)
3. Copy data for all Pokémon following the withdrawn Pokémon back by "one data".

Under normal conditions, this is flawless. However, by having as $FF before the "true" Cancel, the first copy terminates earlier than intened - but the second doesn't. Which means data structures will be passed around from Pokémon to Pokémon following the $FF, effectively "merging" them. You also know why one of the "merged" Pokémon is a $FF hybrid, because the game doesn't clear the $FF ID it copied.

The reason this gives unstable hybrids is that both IDs (the "donor" is the ID in the ID list, the "recipient" is the copy in the data list) don't match anymore, and because different parts of the game's code use either of these for convenience reasons (for example, in battle, only the recipient byte can be used, whereas TMs and HMs use the donor byte to check for a mon's learnpool)


Also, I'm wondering if someone ever tried merging in the party ? It should work, too.
"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 !)

Yeniaul

  • Guest
Re: What Are The Reasons Behind The Merge Glitch?
« Reply #5 on: February 15, 2017, 09:57:42 am »
See? I was right. Torchickens and ISSOtm will and did clarify.
Nice job, guys. High-quality, as usual.

Torchickens

  • Administrator
  • *****
  • Offline Offline
  • Gender: Female
    • View Profile
Re: What Are The Reasons Behind The Merge Glitch?
« Reply #6 on: February 15, 2017, 10:41:58 am »
Thanks, though ISSOtm's explanation was a lot better than mine.

The glitch works with party depositing/giving to Day Care and this was documented before but is a bit obscure.


In fact you can do that in Generation II as well.
https://www.youtube.com/watch?v=KPiJStUldjI
Hello. I actually identify as gender questioning, but nowadays feel more firmly that I identify as female. My sex is male but I like to express myself as female.  She/her pronouns, please.


Thank you Aeriixion for the cute sprite above! :) Roelof also made different variations of the sprite (which I animated).

Contact:

Email Youtube Twitter
Skype: Torchickens
Bulbapedia Starfy Wiki

Beyond all philosophies are the things that go best for you; what makes you feel content. It's important to always follow your heart, so unless you feel perfectly happy about it don't just follow something because it is popular, fits a style or is conventional. Sometimes you may reach a point you're not sure who you are, but as things settle I'm convinced things do work out in time.

ISSOtm

  • The French Lord of Laziness (and a huge The Legend Of Zelda fan)
  • Wiki Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Pewter City (B)rocks !
    • View Profile
    • My Little Website
Re: What Are The Reasons Behind The Merge Glitch?
« Reply #7 on: February 15, 2017, 11:38:14 am »
Thanks, though ISSOtm's explanation was a lot better than mine.
Hehe, thanks !

In fact you can do that in Generation II as well.
https://www.youtube.com/watch?v=KPiJStUldjI
Not surprising, Gen II's engine is mostly based off Gen I (minus a s**t TON of bugs :D)
"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 !)

Torchickens

  • Administrator
  • *****
  • Offline Offline
  • Gender: Female
    • View Profile
Re: What Are The Reasons Behind The Merge Glitch?
« Reply #8 on: February 15, 2017, 12:48:19 pm »
Thanks, though ISSOtm's explanation was a lot better than mine.
Hehe, thanks !

In fact you can do that in Generation II as well.
https://www.youtube.com/watch?v=KPiJStUldjI
Not surprising, Gen II's engine is mostly based off Gen I (minus a s**t TON of bugs :D)

You're welcome. :) Yeah, thinking about it you could probably port over the bad clone glitch. You can kind of do this with the variations of the box byte shift glitch (e.g. remaining HP glitch) but if you removed the only FF terminator for species byte 1 from your party, bypassed the zero maximum HP freeze it might work in the party as well.

Edit: You can, yay! Make the first FF after D16D/C and give Pokémon 1 a HP modulo 256 of your choice, then deposit twice. Your Pokémon will become the same ID as the HP modulo 256 when you take it into Day Care and out. So I wonder if this can be abused with Super Glitch like international fossil conversion glitch.

Edit 2: I did it with a special Super Glitch method that I might show off tomorrow, requiring the glitch item 9F to fix Glitch Cities and three Pokémon with Super Glitch.
« Last Edit: February 15, 2017, 05:26:05 pm by Torchickens »
Hello. I actually identify as gender questioning, but nowadays feel more firmly that I identify as female. My sex is male but I like to express myself as female.  She/her pronouns, please.


Thank you Aeriixion for the cute sprite above! :) Roelof also made different variations of the sprite (which I animated).

Contact:

Email Youtube Twitter
Skype: Torchickens
Bulbapedia Starfy Wiki

Beyond all philosophies are the things that go best for you; what makes you feel content. It's important to always follow your heart, so unless you feel perfectly happy about it don't just follow something because it is popular, fits a style or is conventional. Sometimes you may reach a point you're not sure who you are, but as things settle I'm convinced things do work out in time.

Yeniaul

  • Guest
Re: What Are The Reasons Behind The Merge Glitch?
« Reply #9 on: February 15, 2017, 08:09:14 pm »
I feel jealous now as I'm only riding the information flow and can't contribute to it. And my ear Kleenex just fell out. s**t.

ISSOtm

  • The French Lord of Laziness (and a huge The Legend Of Zelda fan)
  • Wiki Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Pewter City (B)rocks !
    • View Profile
    • My Little Website
Re: What Are The Reasons Behind The Merge Glitch?
« Reply #10 on: February 16, 2017, 06:16:37 am »
From all the really cool s**t I've been seeing around these times, I'd say :

Find a cool idea
Try to do it
Don't give up, find resources and ask people
Post it on the interwebs
Grow up
Look back at it
"Not F*ING bad
 my dudes"

Since you're riding the flow you should have resources on "how to do it". Go on then.
"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 !)

rinlingyo2016

  • GCLF Member
  • Offline Offline
  • i find this stuff fascinating
    • View Profile
Re: What Are The Reasons Behind The Merge Glitch?
« Reply #11 on: March 19, 2017, 05:07:27 pm »
Thank you for your thorough answers :)

I think I understand:
A shifting needs to occur when taking Pokemon out of the box. Everything is shifted above the Cancel button since Cancel should be at the end of the list. However, when we have a Pokemon in the box like Charizard 'M, he's read as the Cancel button, so glitchy things happen to the Pokemon below him. It's as if the game is trying to shift the Pokemon found below Cancel, but it doesn't know how to do it properly, so they become partially shifted and merged together.

We plan to cover the merge glitch at our Pokemon Glitches panel, so I think this is how I'll explain the gist of why the glitch works, and I'll refer them here if anyone wants more detailed explantions.

Krys3000

  • The frenchie
  • Distinguished Member
  • *
  • Online Online
  • Gender: Male
  • Head admin of the PRAMA Initiative
    • View Profile
    • PRAMA Initiative - Main french Pokémon glitch website
Re: What Are The Reasons Behind The Merge Glitch?
« Reply #12 on: March 20, 2017, 01:33:19 am »
I believe indeed it is very important to explain the glitches for those who would like to understand them. This is why on PRAMA we always try to write an optionnal "technical explanation" section for every single page we write. When I personally don't know something about a 1G glitch, I usually ask ISSOtm since he's the team expert for these. Otherwise I ask here or I annoy Torchickens :D

Well those pages are in French obviously but if you need something that we wrote you could probably Google translate or just ask! We might wanna add a similar feature here for the glitches in the wiki that still requires explanation.

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