Finally my first post about game engineering, I looked forward to it 🙂 Since I posted reviews 3 times in a row, I will try to post about engineering a bit more often the coming posts (I have other ideas), but just be aware that from now on, the contents are going to be new and not pasted from my old one. Hope you’ll enjoy my perspective on video game engineering 🙂
This glitch and everything surrounding it is the most fascinating glitch I ever heard of and this is why it is also my favourite one. In fact, this is the first big glitch that when I found why it worked by curiosity, it started my passion for how software and video games were made in logic.
Considering how known it is, I don;t need a big explanation for what it is in general. If you don’t know about it however, basically you can encounter a Pokemon in red/blue version that looks like the picture above by doing……interestingly very simple manipulation. There is multiple way to do this, but as it’s the most well-known one, I will talk mainly about the old man method.
Why is it fascinating?
Simply because of how much elements relating to deep computer memory stuff is present. When I first heard of the causes, I was fascinated by how it basically reminds you that programs are just sequences of instructions that tries to get right, but when they don’t, contradictions can happen and the missingNo glitch happens to be one of the biggest contradiction you can get from simple programming error and sensitive data structure.
In fact, the fact that it even works and doesn’t end up crashing the game is already fascinating, the random nature of the effects is why it’s my favourite glitch. Everything seems so random until you look up why they happen and you would realise how complex such a glitch can be.
Explanation of what is missingNo
A lot of people might know this part, but missingNo actually is a dummy Pokemon slot that is bogus. Well……actually, the surprising thing about it is that the slots for these missingNo actually exists in the database of the game. There’s proof and several evidences saying the game originally had 190 pokemon in it and this is even shown in the database containing the pokemon data slot where you see 151 legitimate data and 39 slots containing place holder data (such as the name which stands for missing number). This pretty much means that when you encounter a missingNo, you are accessing data that exists…..except for some parts that are wrongly accessed in the game memory.
In fact, the entire reason missingNo exists and can be encountered without having a game crash is because the data that the game access are seen as valid while they clearly are not. And the most interesting thing about the reasons they are valid is complete coincidence, it just HAPPENS to work that way.
I will explain more as this post goes, but for now, I will just walk you through the old man method and explain as I go and point out why it’s doing illogical stuff.
Preparing the glitch
As I said before, the procedure is surprisingly very simple. So, the old man method involves talking to the old man in the game that will give you a little tutorial on how to use poke ball. The reason you have to talk to him…..is rather weird because it has to do with your name. See, normally, if you use a poke ball, your name will appear saying that [your name] used a poke ball. However, what happens with the old man is instead of hard coding the text to display “OLD MAN” like most would expect, it actually reuse the same text where your name would appear and temporarily changes your name to OLD MAN. This strange procedure is likely because the GameBoy is a very old console and at the time, memory were expensive and very limited. By reusing the text, the developer likely would save precious memory at the expense of using…..let’s be honest, very questionable logic.
But how does changing your name matters? Well variables in computers can only serve to do 2 things on them: read or write. That’s it, there’s of course operation you could do with them, but on the variable directly, you essentially do a lot of read and write to achieve this. So, if the game were to change your name to old man, logically, it would have to assign it back to what it was before, but to do this, it has to be written somewhere. This is exactly what the game does but for very very strange reasons (I have no idea why they made it that way), the location this happens is actually IN THE ENCOUNTER LIST! This means that after the tutorial has been completed, your name is put back to where it was, but the encounter list is actually messed up. Instead of containing meaningful data (Pokemon, levels rates, etc….) it contains the data representation of the text of your trainer name.
As illogical as this sounds, this data could be read by the game just fine, the game doesn’t know that the data is messed up, if you were to attempt to do an encounter, the game will just check the list and deal with it as how it interprets it. It will of course make absolutely no sense, but it’s going to happen because the game trust the data. You could normally prevent this with checks on the data, but giving how much memory usage was a huge concern back then…..that could have been skipped.
In fact, they actually try to prevent this list as is to be read. Because if you were to go to a route or encounter locations, the list will get written to have the new data overwriting the mess that it made after the tutorial. So now you might see why it would be fine to not perform checks: the developer could simply assume that you cannot allow the game to read that list, by the time you would attempt it, the data would already be updated. They simply have to tell the game to write data when you come to a location when you could get encounters. As unsafe as this storage method would be, that would make it just work so it’s fine right?
The entire reason you CAN encounter missingNo
There is a bug in that update system. SOME (around 2-3) locations aren’t programmed to update the list as they should be. One of these locations JUST HAPPENS to be on the right shore of a town that the game allows you to fly to it and flying wouldn’t update the list, but getting on the shore SHOULD HAVE caused an update and it DOESN’T!
Which is exactly why flying to that city and surfing on the right shore is the next step of that method. When you think about it, this mistake is quite trivial in itself, at worst, it would normally cause a wrong, but valid encounter list. The problem is that the tutorial as explained earlier tamper with that list so this isn’t just trivial here, but it can go catastrophically wrong. What the game just allowed you by accident is to encounter invalid Pokemon data!
Which is where missingNo comes into play. Because your name (by this I mean the characters in it) is the encounter list, a very wide variety of Pokemon can be encountered, even ones that don;t even exist/aren’t used. And I just said there’;s 39 indexes that has unused and dummy slots….
That part was very interesting to me because it shows that glitches aren’t consistent at all, they are literally caused by bugs which are logical error. The game cannot detect this, the developer told the game to be illogical so it will be. Which is why the mere possibility of this encounter happening is already interesting in the sense that fundamentally, all they did wrong was forgetting to overwrite the encounter list on the shore. That is the ONLY reason this event can occur as long with the unsafe name writing solution, but that part was done on purpose and it was tried to be made so it would not happen.
So, as catastrophic as this glitch occur, this isn’t the most interesting part….
So, even if the encounter was possible, it doesn’t explain why missingNo is SO MESSED UP to the point where….everything makes no sense.
The reason is again, the developer assumed that you couldn’t access the missingNo slots (they are unused after all). however, you can so that oversight causes memory to be read……where it clearly should not. Because missingNo contains dummy data so if you were to read it as a legitimate Pokemon (which is NOT), you end up reading data that isn’t pokemon related. In fact, it ends up reading TRAINER data and the trainer data in question has NOTHING to do with the situation you are!
So, trainer data has a format and of course, Pokemon data has another. What is happening is that you have a pokemon where its data is read in the trainer data as pokemon data…….for obvious reasons, this is so much non sense that it leads to…..illogical stuff. For example, why is missingNo shaped like a backward L? Well the size read (which as I explained is pure coincidence) is higher than what the game allows so when it is read……it just looks messed up.
So you end up with a Pokemon that you can catch (its catch rate is coincidentally acceptable) and the pokemon is not making any sense……wow.
So what this shows is that the data in the games is defined by the developer and the game is told to read it that way. At the end of the day, the data…..is still data with numbers and just that, it’s just managed in a pattern that make sense. So reading data using a bogus pattern in a wrong location…..is basically giving the weirdest effect you can get.
And as it seems to be done, nope, there’s more.
About the item duplication
Most people knows this, but your sixth item after the encounter gets increased by 128……WHAT?
Well there’s a table in the game where it says whether or not has been caught or seen. So, if you catch the missingNo, it has to set that flag……but because of its messed up interpretation of location, it JUST happens that the bit that is flipped is the first byte of the sixth item so what it means is it adds 128 to the amount…..wow.
Conclusion: why this is fascinating
I didn’t even went through the technical stuff and it’s already fascinating to see why it even works. What has been involved in this glitch is reading the wrong memory, getting access to unused feature not even designed to be used, exploiting the game storage mechanics, getting side effect of writing to the wrong data and the most interesting part: reading the wrong data in the wrong format.
To me, it shows an interesting facts about programs: they are limited by what they are told to do. All of these elements are wrong in theory, but in practice, the game just did what was right since it was made what was believed to be the right way.
The other interesting fact about these elements is how complex they are. It shows that the complexity of simple features of a game can be so much that it might hurt your head and also that the glitches exploiting the deep part of them can be as complex.
This is a type of logic that I love btw. It’s like chess, it takes less than an hour to learn the rules and they are very straight forward to learn. So the theory is very simple, but in practice, playing chess RIGHT is VERY hard and requires a lot of experiences and skills to become good at it. Software engineering is really the same, to give you an idea, in programming, you can only do 3 control structure: sequence of ordered instructions, loop and conditional branch. That’s it, you can only do that, but in practice…..well it’s even hard to imagine that the browser you are using to view this post is just made of these 3 structures, but it is!
So for me, exploring how these structure can be broken is something I love. This is how I eventually got involved with the speedrunning community to glitch hunt TTYD and still glitch hunt Super Paper Mario now.