[ARCHIVE] Simple Questions (SEARCH BEFORE ASKING A QUESTION)
View Single Post
March 17th, 2013 (11:13 AM). Edited March 17th, 2013 by miksy91.
Dark Energy is back in action! ;)
A small country in the North
Originally Posted by
Edit: I figured out the formula!
Okay, for moves that are numbered 255 and below, they are stored [move number] [level x 2].
For moves above 255, they are stored [move number - 255] [level x 2 + 1]
So, as you can see, if the level byte is odd, it knows to read from the set of moves above 255 and if it is even, it reads from the set of moves below 255. Quite the thought that went into this one!
Yeah, looking at the pattern like that, it doesn't make much sense. But even so, there is some rational solution to why Gamefreak wanted to program the move learning pattern like that, and I believe that is the fact that Gen III games won't allow the level of the encountered pokemon being higher than 127 (or "100").
This leaves the highest bit of the level value unused which can be used as part of the move learning routine. Now instead of 8 bits, 9 bits can be used to describe each move, by using the highest bit of the level value as one. This kind of a method allows 512 moves to be stored in the game.
But you're right about the fact that the pattern doesn't look that user-friendly. But the fact is that it doesn't have to, not while being viewed with a hex editor. Because the original games were programmed by creating a disassembly, a "text document" holding all the in-game data that could be compiled into a rom file using an asm compiler (unless they simply wrote the game using a real programming language, can't really tell). This kind of a game developing method leaves more possibilities into actual game developing, without having to pay attention to all existing structures so much.
My Rom Hack
Fixing bugs in a ROM hack
CP of encountered pokemon in GO
Learn how to hack GB/C games:
Check my GameBoy/Color hacking videos in Youtube
-The video set uses Pokemon Silver (U) rom for demonstrations
Joined Oct 2008
View Public Profile
Send a private message to miksy91
Find all posts by miksy91
Find threads started by miksy91
Ignore Posts by miksy91