As a bit of a precursor I will mention that you don't need programming experience to poke around and make some simple changes, though it surely doesn't hurt. Available over at the pokeemerald GitHub repo you can find the vast majority of the game's underlying workings transcribed to some pretty damn readable C code. I won't pretend to understand the process of decompiling a game and getting it to this state, but the folks behind this project have made it entirely trivial for anybody to follow a simple list of instructions and build the game for themselves. With such power, how could I not want to poke around a little and fine-tune this already-great game to my liking?
If you managed to follow the instructions on the setup page, what you'll be looking at is a built "pokeemerald.gba" ROM, and a whole bunch of files you don't know what to do with. To make the project a bit easier to navigate, you'll want to pick an IDE to load it into, with one of the more accessible (and free!) being Visual Studio Code. This is basically a lightweight code editor with a bunch of plugins you can use that's able to load the full breadth of the project for you. This lets you move quickly between files, but perhaps more importantly for surface level edits like what we have planned here, lets you search for keywords through the entire project. This is really important if you operate the way I do.
Adding More RNG!
We're basically all setup now, so let's actually get started on making some edits; making the Focus Band always active seems like a good first task. If you've managed to sleep on this item, it's one of very few viable items for competitive battling in Gen 3, and is held by a colossal 80 Pokemon in the Battle Tower (and 24 in Trainer Hill if you remember that's a thing that exists in Emerald). Its purpose? To provide you with a 10% chance to survive any hit. A reusable 10% chance I might add. It throws in that bit of extra spice that Pokemon battling really needed on top of the variable damage formula and random critical hit chance. So where do we start? With the decompilation being labelled so well, searching for "FOCUS_BAND" across the project seems like a good place. You can do this in VS Code by clicking on the Search button on the left bar, or pressing Ctrl+Shift+F. And would you look at that, 150 results in 22 files!
This usage is split between a few different variables, and the way it works is actually pretty simple to follow. "ITEM_FOCUS_BAND" is the value that's used to say the item is being held, and if it is being held, the hold effect is set to "HOLD_EFFECT_FOCUS_BAND". Following that, the hold effect of the currently held item is checked against all known values in the "battle_script_commands.c" file to see which effect should happen. For the Focus Band in particular, it rolls a random number between 0 and 99, and if the value is less than 10, the effect triggers. We want this 10% check to remain intact, but we can kill the check for actually holding the Focus Band.
Changing the Natural Order
Moving onto my next goal, adding new natures largely followed a similar pattern. The idea here is that if we want to make a new nature we should probably search for instances of an already-existing nature and copy what they do, and a search for "BASHFUL" gives some good results.
I did actually edit PickWildMonNature myself to make my new natures appear as a separate 1/100 check
Making Nuzlocke Players Actually Fight Trainers
My last two changes of this post go somewhat hand in hand. In recent times, nuzlocking, the act of beating a Pokemon game with a number of set restrictions, has moved on a little. Gone are the days of forming an attachment with your team and getting through the games by any means necessary. Nowadays "hardcore nuzlockes" are all the rage on YouTube, and a large component of these playthroughs are a level cap that restricts your team's level to the strongest Pokemon of the next gym leader's party. These level limits are self-imposed, and these players often use Rare Candies to ensure their whole team is at the limit for the boss fight. We can do better.
The easiest way I could find for implementing a level cap was to just ensure a Pokemon didn't level up unless we had enough badges. This means any experience gained while at the level cap will still be stored, and then be used after the next badge was obtained. There's actually only two places edits need to be made here, and the flags we need to check already exist for each gym badge. After a bit of searching, I landed in the "battle_controller_player.c" and "pokemon.c" files, the former handling the act of levelling up in battle, and the latter being something I only really stumbled upon after a bit of play testing.
Now that's out of the way, let's look at tackling the use of Rare Candies. I get it, grinding is tiresome. So let's just multiply the gained experience by, say, eight. On top of this, we can make it that you gain no experience for fighting wild Pokemon. I think this is actually pretty balanced, and a bit more of a fun approach when compared to using Rare Candies. This basically means that grinding isn't a chore, but it also means that you do need to pick and choose some optional trainers to fight between your big challenges. It keeps the game fresh and challenging, and it's just three lines of code! This one took me more tracking down than I'd care to admit, but it culminated in the below lines in the "battle_script_commands.c" file. It looks so simple, and that's really because it is! A weird note is that gBattleMoveDamage is used to store the gained experience for some reason, and it needs to be set to 1 for wild Pokemon as opposed to 0 to avoid a softlock if you've gained 0 experience but are already over the threshold for levelling up… A conundrum I introduced myself with the previous tweak.
See You Next Month!
So that was my March. I did play a few other things, but with this being so interesting to me I wanted to really shine a spotlight on it. I'll be back next month with some pretty heavy JRPG gaming having recently downloaded Final Fantasy 7 Remake on Steam. Will I actually manage to get through such a game with my limited time and motivation? We'll find out at the end of April!