Old man glitch

The old man glitch is a well-known glitch in , and an extension of the Fight Safari Zone Pokémon trick. It is one of the methods by which the player can encounter MissingNo. and 'M (00), and almost certainly the most famous method. Its name comes from the in Viridian City, who is required to begin the glitch. It should not be confused with the related item duplication glitch, which is most easily performed by first performing the old man glitch.
This glitch was not present in the Japanese Pokémon Red, Green, or . This glitch was fixed in the Spanish and Italian versions of Pokémon Red and Blue by making the shore tiles act as water tiles, but still remains in the German and French versions of Pokémon Red and Blue; however, in the French version, the game freezes upon encountering a MissingNo. or 'M (00). This glitch was removed in all versions of by blanking the data for wild Pokémon before overwriting it, and reprogramming the shore tiles to not call any wild Pokémon.
==Performing the glitch==
The glitch is a special case of the Fight Safari Zone Pokémon trick. To perform the glitch, the player must talk to the old man located in the north of Viridian City and allow him to demonstrate how to catch a Pokémon. After the demonstration, the player should immediately to Cinnabar Island. Here, the player should surf up and down along the east coast of the island where the water is touching the land without leaving Cinnabar Island. Wild Pokémon will appear, based on the player's name.
==Effects==
The wild Pokémon that appear are based on the index numbers of the characters in the player's name. The third, fifth, seventh, ninth, and eleventh slots of the player's name are the species of Pokémon that will appear (see table below). The second slot of the player's name becomes the level of the Pokémon caused to appear by the third slot, the fourth slot for the fifth slot, the sixth slot for the seventh slot, the eighth slot for the ninth slot, and the tenth slot for the eleventh slot. However, due the seven character name limit, only the first seven slots can be directly chosen by the player; the remaining slots contain filler data that varies with the method that was used to choose the player's name. Regardless of the method used, the player's name is terminated by a special character to mark the end of the name which has the index number 80.
If the player uses a custom name, all characters after the end of name marker are blank (00). This causes 'M (00) to appear at level 0, and if the player's name has an odd number of characters, at level 80 as well (due to the positioning of the end of name marker). Due to the ninth through eleventh slots necessarily being blank for custom names (due to the character limit for names), 'M (00) can always appear for custom names.
If the player uses a preset name, instead of the following bytes being blank, they are filled by the sequence of other preset names separated by end of name markers (with NEW NAME after the last preset name). As such, 'M (00) will not appear when using a preset name.
==Results==
===Custom name===
This table demonstrates what Pokémon specific characters in the player's name will cause to appear, or the level of the Pokémon that they will cause to appear. Only characters possible to include in the player's name are included; the null character (0) cannot be inserted by the player, but instead fills the remaining slots after the end of name marker (80) at the end of the player's name. Glitch Trainers are in bold.
{| border=1 width="100%" class="sortable" style="background: #FFF; border:1px solid #; border-collapse:collapse;"		 	
 		Pokémon 	Level
 		'M (00) 	0
 		MissingNo. 	80
 		MissingNo. 	127
A		 	128
B		 	129
C		 	130
D		 	131
E		 	132
F		 	133
G		MissingNo. 	134
H		MissingNo. 	135
I		 	136
J		MissingNo. 	137
K		 	138
L		 	139
M		MissingNo. 	140
N		 	141
O		 	142
P		 	143
Q		 	144
R		 	145
S		MissingNo. 	146
T		 	147
U		 	148
V		 	149
W		 	150
X		 	151
Y		 	152
Z		 	153
(		 	154
)		 	155
:		MissingNo. 	156
;		 	157
[		 	158
]		MissingNo. 	159
a		MissingNo. 	160
b		MissingNo. 	161
c		MissingNo. 	162
d		 	163
e		 	164
f		 	165
g		 	166
h		 	167
i		 	168
j		 	169
k		 	170
l		 	171
m		MissingNo. 	172
n		 	173
o		MissingNo. 	174
p		MissingNo. 	175
q		 	176
r		 	177
s		 	178
t		 	179
u		 	180
v		MissingNo. 	181
w		MissingNo. (Kabutops Fossil form) 	182
x		MissingNo. (Aerodactyl Fossil form)	183
y		MissingNo. (Ghost form) 	184
z		 	185
 		Rival 	225
 		 	226
–		 	227
?		 	230
!		 	231
♂		Blaine 	239
×		 	241
.		Rival 	242
/		 	243
,		Lorelei 	244
♀		 	245
===Preset names===
Choosing a preset name will result in different results to inputting a custom name. Inputting a custom name which is the same as a preset name will not cause the glitch to behave as if a preset name was chosen.
Preset names function differently because they are stored one after the other in the game data, separated by the end of name marker, whereas custom names are succeeded by zeros after the end of name marker. In English Pokémon Red, the player's name is stored as "RED<end>ASH<end>JACK<end>NEW NAME", starting from the selected name; in English Pokémon Blue, the player's name is stored as "BLUE<end>GARY<end>JOHN<end>NEW NAME", likewise starting from the selected name.
Due to the names extending past the usual seven character limit, the ninth and eleventh characters are also used to determine the wild Pokémon, and their levels are determined by the eighth and tenth characters, respectively. These characters are usually null, so cause 'M (00) to appear, and Pokémon to appear at level 0, respectively. Because of this, unlike when inputting a custom name, 'M (00) do not appear when using a preset name. Characters after the eleventh are ignored.
====Pokémon Red====
The numbers in parentheses are the index number of the specific MissingNo. in hexadecimal.
{| border=1 width="100%" style="background: #FFF; border:1px solid #; border-collapse:collapse;"	 	 	 	 	 	 	 	 	 	
Name	Level 1	Pokémon 1 	Level 2	Pokémon 2 	Level 3	Pokémon 3 	Level 4	Pokémon 4 	Level 5	Pokémon 5
RED 	132 	 	80 	 	146 	MissingNo. (87)	80 	MissingNo. (89)	128 	
ASH 	146 	MissingNo. (87)	80 	MissingNo. (89)	128 	 	138 	MissingNo. (50)	141 	
JACK	128 	 	138 	MissingNo. (50)	141 	 	150 	MissingNo. (7F)	141 	
====Pokémon Blue====
The numbers in parentheses are the index number of the specific MissingNo. in hexadecimal.
{| border=1 width="100%" style="background: #FFF; border:1px solid #; border-collapse:collapse;"	 	 	 	 	 	 	 	 	 	
Name	Level 1	Pokémon 1 	Level 2	Pokémon 2 	Level 3	Pokémon 3	Level 4	Pokémon 4 	Level 5	Pokémon 5
BLUE	139 	 	132 	MissingNo. (50)	134 	 	145 	 	80 	MissingNo. (89)
GARY	128 	 	152 	MissingNo. (50)	137 	 	135 	 	80 	
JOHN	142 	MissingNo. (87)	141 	MissingNo. (50)	141 	 	150 	MissingNo. (7F)	141 	
==Cause==
When the game sets up the battle between the and a , it needs to temporarily change the player's name to "OLD MAN" so that it will display that name, rather than the player's entered name, during the battle.
The programmers decided to use the space where data for wild Pokémon found in the grass is stored (which is completely blank in Viridian City, as only ing and Fishing data is used) to save the player's name temporarily. Normally, this would cause no abnormal activity, as this data is overwritten when the player moves to a different area.
In all cities, however, this data remains blank, and so the data is never overwritten (as there is nothing new to overwrite it with), and thus, the data that was last entered (be it the player's name or the wild Pokémon data from another area) remains in place. This itself still causes no harm; however, an oversight in the programming of the tiles used to denote the shore of Cinnabar Island marks them as equivalent to grass. As all water routes have no real grass on them, likewise, the data is not overwritten, and so whatever data is in the slots for wild Pokémon found in the grass is used, be it the player's name or wild Pokémon found elsewhere, such as the .
The name of the player has six hexadecimal values in it. The game needs only three "slots" of wild Pokémon data to store this.
The species of wild Pokémon the player encounters along the coast are determined by the third, fifth, and seventh characters of the player's name, while their levels are determined by the second, fourth, and sixth characters, respectively. The game also reads the ninth and eleventh slots as wild Pokémon and the eighth and tenth slots as their respective levels; however, due to the seven character name limit, these slots are not used unless using a preset name, so are blank (00), causing 'M (00) to appear at level 0.
In , and , this glitch does not happen because the wild encounter tile is at position (8, 9), with the top-left tile on the screen being (0, 0), meaning the bottom left tile of the 2x2 block the player is on determines if they can encounter wild Pokémon. It got erroneously changed to (9, 9) in the international releases, meaning the bottom right tile is used for this purpose instead."Left Shore can spawn Pokémon" (wiki page of pret/pokered repository) For the same reason, blocks with a star on the bottom right tile in Viridian Forest cannot generate wild encounters; this is known as the 2x2 block encounter glitch and has been used in numerous speedruns. This was also fixed in Pokémon Yellow.
==Other coast related exploits==
:See also: Fight Safari Zone Pokémon trick 
Because Cinnabar Island has no wild Pokémon data but the potential for wild Pokémon to appear, and that wild Pokémon data is not formatted when entering a new area, any location that can be from can have its wild Pokémon available on the coast.
This includes the , so players can encounter Safari Pokémon under normal battling circumstances. Since the old man only writes to the first eleven wild Pokémon addresses, it means that extra Pokémon may be accessible even if the player's name is eleven characters long (which is possible with preset names). This grass Pokémon data is mapped to three 'uncommon encounters' and two 'rare encounters'.
Due to being able to find Pokémon over level 100, it is possible to trigger glitches relating to Pokémon with levels that are too high. If Pokémon over level 100 receives experience by battle, it will automatically go to level 100; Rare Candies will level up the Pokémon normally. If the Pokémon's remaining HP is already low, dropping to level 100 can cause the HP to drop to negative number, but it will be interpreted as a very high number, similarly to the Pomeg glitch. In Pokémon Stadium, HP is shown as the actual amount; in Pokémon Stadium 2, it will act as if its HP was full.
Reportedly, the first coast exploit discovered involved performing an in-game trade with an NPC and surfing on the coast.Okk's MissingNo. guide This results in five level 80 hex:50 MissingNo. because the encounters are affected by the trade Pokémon's OT name. Specifically, grass data is overwritten with "5D 50 50 50 50 50 50 50 50 50 50". The 5D byte is a control character that prints "TRAINER" and the rest of the bytes are 'end name' characters.
Trading or fighting in the Cable Club overwrites the wild Pokémon data with the opponent's name, and by using the poison method of the Cable Club escape glitch one may escape from the Cable Club and keep the stored grass Pokémon data that normally disappears after resetting the game (even after trading). Note that battling heals the user's Pokémon, meaning that the player has to do this glitch by bringing up the trade screen.
This Cable Club coast exploit has an unexplained complication of affecting encounters further than uncommon Pokémon 1 (D891); for example, glitch Trainer FD can appear on the coast through this method.
Video of the trade NPC exploit:
Video of the Cable Club trade exploit (which requires the Cable Club escape glitch)
==References==
==Related articles==
Category:Glitches
fr:Bug de la rive droite de Cramois'Île
it:Glitch del vecchietto
zh:老人（漏洞）