Spacewalker

Exploring the universe.

Age 15
Male
Multiverse
Seen 2 Days Ago
Posted 1 Week Ago
826 posts
1.7 Years

Introduction
The Complete FireRed Upgrade, as the name says, is indeed a complete upgrade of Pokémon FireRed. It even consists of features which none other base has for Gen III yet, a few of them being Dynamax, a complete set of move animations, an immensely improved AI system, you get the gist. In my opinion, there isn't a better base for Gen III.

I'll go ahead and quote ghoulslash here: "This project is a massive engine upgrade for Pokémon FireRed. It includes an updated battle engine on par with the current generation's, including every single attack, ability, item, AI, and more. In fact, this is the only game engine in Gen III with every single move animation! In addition, it includes several game improvement features such as Expanded PC Boxes, a DexNav, dynamic overworld palettes, character customization, TM/HM expansion, a Battle Frontier, and many others. Most of the engine features are easily configurable to the user by simply commenting and uncommenting lines. An extensive documentation has been written to fully explain what this engine is capable of and how to use all of the features contained within. In addition, most table data is untouched or is loaded directly from the rom, allowing this engine to be smoothly implemented for (most) existing hacks!"

As ghoulslash said, this engine updates if not every, 95.00% of all the aspects of vanilla FireRed. I bring this tutorial in hopes that other people can recognize and use this engine.

There are two methods for setting up the Complete FireRed Upgrade. I personally recommend the second method, but it is entirely up to you. The second method makes pulling any update from the original CFRU repository much easier. In the first method, you'll have to download the CFRU again and again whenever it is updated, not to mention you'll have to match any files you've edited from the old one to the new one, whereas in the second method, all you'll need is one command.

Setting up the CFRU (first method)
Spoiler:
Setting up the CFRU may seem like a hassle, but practice makes perfect. The things you are required to have are:
  • DevKitPro [dl]
  • Python (3.7.6) [dl]
  • A vanilla FireRed [1636 - Pokemon Fire Red (U)(Squirrels)]
That's about it. Python and DevKit are two essential things for the CFRU to work, so they are a must. How do we utilize them? For simplification, this segment will be broken into two parts:

1) Initial ROM steps:
Please note that I would recommend to skip to the step below (Compiling the CFRU) to understand as in how to insert it in a ROM, and come to this step (Initial ROM steps) after learning how to properly insert it in a ROM. When learning to insert the CFRU for the first time, use a vanilla ROM.

It is NOT recommended to edit a ROM which has the CFRU inserted in it. The CFRU can ideally be applied to a ROM only once. This means that all the editing, whether it be spriting, scripting, mapping or graphics modification, is done prior to applying the CFRU. This is to avoid having issues and bugs in your ROM, since the CFRU is an extremely heavy insertion that may cause oddities in your ROM if the ROM is edited after the CFRU being inserted. I would suggest again to first of all learn how to insert the CFRU in a vanilla ROM, and come back to "Initial ROM steps" later.

With that warning out of the way, you can add any of the following relevant additions (this isn't necessary of course. You can simply skip these additions, do your own mapping, scripting, graphics editing etc, and compile the CFRU as told in the next step).
The following are a list recommended add-ons created by other users of the PokéCommunity that for some reason or another, were chosen to be left out from this engine. If you choose to apply any of these, they should be applied prior to applying the engine.

General:
Music:
After adding any of the above stuff, or none at all, follow the "Recommended Insertion Steps" in the documentation provided with the CFRU (at the first step, it'll be told to insert the DPE [same insertion method as CFRU] to your ROM. The insertion method is explained in the next step). Once that's done, you're free to map, script, and whatever else you can think of (should be compatible with CFRU). When you're ready to test what you've done so far, insert the CFRU into your ROM. For any clarification regarding the "Recommended Insertion Steps" in the documentation, have a look at the spoiler tag below.
Spoiler:


2) Compiling the CFRU:
Please note that these steps apply to DPE as well.

If you've added any of the above things, some changes may need to be made. Any of those changes are mentioned directly and others are provided in the download.

Before applying the CFRU you can change the offset in where you insert it. This can be found in CFRU master folder/scripts/open "make.py" in a text editor/OFFSET_TO_PUT = 0x900000/Change the "900000" however you like (must be in the ROM). It's better to expand your ROM to 32 MB before inserting the CFRU + DPE. I'd recommend the CFRU at x1600000 DPE at x1800000.


How to apply the CFRU (same steps as DPE):
  • Download and install DevKitPro (get it here). Run the setup, click next and check "download and install/install from downloaded files". I recommend installing it somewhere as simple as C:\devkitPro (installing it at the desktop did not work for me). For the sake of this tutorial, I've installed DevKitPro in C:\devkitPro:



  • Now it's time to add devkitARM's (included with DevKitPro) bin folder to your path. Here's how to do that:
    Go in "This PC"/Left Click "Properties"/"Advanced System Settings" (on the left side)/A window will open; look at bottom of that window; "Enviromental Variables"/In the "System variables" box (the 2nd box) scroll down until you see "Path" (the one highlighted in blue):



  • Double click "Path"/Follow the image below to add it to your path there (doesn't matter what the rest look like; keep eyes on the highlighted one; click "New" to add):



  • RESTART YOUR COMPUTER! Come to the next step after doing that.

  • Download the latest Python 3.7 (3.7.6) (download here). DO NOT DOWNLOAD PYTHON 3.8! After downloading and before proceeding to install, make sure that the add to path checkbox is ticked, otherwise you'll have to add the Python path in the environment variables manually.

  • Download the CFRU master folder from the GitHub page (Click 'Code', then 'Download Zip').



  • Get your ROM, rename it to "BPRE0" and place it the main (master) folder.



  • To decide the offsets where you want to insert the code: In 'scripts/make.py' change "OFFSET_TO_PUT=0x900000" to the location you want to insert the data (as said above).



  • Run PowerShell or Command Prompt from the main (master) folder. PowerShell is default set in Windows 10, so it's better to use that. To open, press Shift/Right Click/Select "Open PowerShell window here":



  • In the Power Shell or Command Prompt window (your choice), type python scripts//make.py; hit Enter.



  • This should show up (it marks that the CFRU is being applied successfully):



  • You should get two relustant files: test.gba and offsets. You've successfully applied the CFRU to your ROM.


Setting up the CFRU (second method)
Spoiler:
With this method, we can easily pull any updates from the original CFRU repository, have our own CFRU fork repository, and push any updates made by us to our repository. This may seem confusing at first, but after awhile, it'll be easy as pie. In this method, we'll be using WSL.
Following are the things you'll need:
  • DevKitPro [dl]
  • Python (3.7.6) [dl]
  • Ubuntu 18.04 LTS [explained in steps below]
  • Personal GitHub account [explained in steps below]
  • A vanilla FireRed [1636 - Pokemon Fire Red (U)(Squirrels)]

1) Setting up DevKit and Python:
  • Download and install DevKitPro (get it here). Run the setup, click next and check "download and install/install from downloaded files". I recommend installing it somewhere as simple as C:\devkitPro (installing it at the desktop did not work for me). For the sake of this tutorial, I've installed DevKitPro in C:\devkitPro:



  • Now it's time to add devkitARM's (included with DevKitPro) bin folder to your path. Here's how to do that:
    Go in "This PC"/Left Click "Properties"/"Advanced System Settings" (on the left side)/A window will open; look at bottom of that window; "Enviromental Variables"/In the "System variables" box (the 2nd box) scroll down until you see "Path" (the one highlighted in blue):


  • Double click "Path"/Follow the image below to add it to your path there (doesn't matter what the rest look like; keep eyes on the highlighted one; click "New" to add):



  • RESTART YOUR COMPUTER! Come to the next step after doing that.

  • Download the latest Python 3.7 (3.7.6) (download here). DO NOT DOWNLOAD PYTHON 3.8! After downloading and before proceeding to install, make sure that the add to path checkbox is ticked, otherwise you'll have to add the Python path in the environment variables manually.

2) Cloning the CFRU:
  • Open the Windows Command Prompt as Administrator (look up "Command Prompt on your Start Menu, Right Click -> Run as Administrator).
    Once you've done that, execute the following command:
    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all
    When the process finishes, you'll have to restart your PC by pressing "Y" to finish the process, so keep that in mind.

  • Go to the Microsoft Store and search "Ubuntu 18.04 LTS". Go to its page in the store and click the blue "Get" button.

  • The installation is as straightforward as any other program's. Open it, hit Install and wait until it's done. Launch Ubuntu when the installation finishes, so it can start its own setup. When Ubuntu opens, we'll be greeted by a command line window telling us that Ubuntu is: "Installing, this may take a few minutes...". Once we're ready to proceed, we'll be asked to introduce a username (in lowercase letters) and a password. Don't worry if you can't see the password as you're typing it, it's a security measure.

  • After that, the installation will be completed and we can safely close the window of Ubuntu. Why is that? Because from here on, we'll run Ubuntu by typing "wsl" on the Run window (Win Key + R). By running WSL this way, we'll be taken directly to the Windows Filesystem instead of Ubuntu's. More specifically, WSL will always open pointing to the C:\Users\USER folder. We can also run Ubuntu from the context menu by pressing "Shift" and right clicking on "Open Linux shell here". This allows you the open the Linux shell in any folder.

  • The very first thing you generally do after installing a distribution of Linux, is to update its list of packages. To do this, we'll use the following command:
    sudo apt update
    Once we hit Enter, we will see that Ubuntu will retrieve different lists of packages from multiple sources. This is done so it can find the latest versions of each package and library you need.

  • Now that we updated our list of packages, let's update all the packages in our installation of WSL/Ubuntu.
    To do this, we'll use the following command:
    sudo apt upgrade
    We'll hit the "y" key to tell WSL/Ubuntu that we want to update everything, and then the process will begin. Keep in mind that this'll probably take a long time. There's nothing to be done about it. Endure it. At some point during the process, you'll be asked to confirm whether you want WSL to restart automatically during package updates. We'll select "Yes" and press Enter. The process will then proceed. Once it's done, we move on.

  • To clone the CFRU, we'll first have to make a fork. To make a fork, we need an account:
    • Let's head on to GitHub, click the "Sign Up" button in the top right corner, and create an account as you normally would. Once you have activated your account, GitHub will automatically take you to the page where you can create a repository. But we won't make a repo just yet.
    • Let's link our GitHub account. It's pretty simple. Go back to your shell/terminal and execute the following commands (type USERNAME and EMAIL between the quotation marks):
      git config --global user.name "Insert your GitHub account's username here"
      git config --global user.email "Insert your GitHub account's email here"
      Note: If you're using WSL and you get the following error: "error: could not lock config file /path/.gitconfig: No suck file or directory.", don't panic. I had it happen to me as well. To fix it, I just had to set my GitHub account's name and email on a per-folder basis, meaning that each time I clone Pokeemerald, I'd have to use these commands within the project's folder on WSL, but without the --global parameter.
      I'm not completely sure if it's the best way to go about it, but it's a solution that works.

  • Let's head back to https://github.com/Skeli789/Complete-Fire-Red-Upgrade. Click on the top right "Fork" button:

    It'll take a few seconds, but you'll be greeted with a page similar to the original CFRU page. Remember that this your copy (fork), and not the original CFRU page.

  • Now, on our computer, let's head to our desired location where we want to clone our forked CFRU folder. For the tutorials sake, I'll clone our CFRU fork in C:\Users\USER (if you closed the shell/terminal, reopen it by either the context menu or by typing "wsl" on the Run window [Win Key + R]).

  • When we are in our desired location, let's make a dedicated folder to use for our CFRU project here. You know, to keep things clean.
    mkdir CFRU

  • Good, let's move to this new folder by using:
    cd CFRU

  • Now, we'll clone our CFRU fork on our computer by running this command:
    git clone https://github.com/USERNAME/NAME_OF_YOUR_REPOSITORY
    So, for example, for me, it'll be:
    git clone https://github.com/TheRealSpacewalker/Complete-Fire-Red-Upgrade
    It'll take a while, but after it's done, we should have folder called "Complete-Fire-Red-Upgrade" in the folder "CFRU" we made.

3) Linking our project with GitHub:
  • Let's move in our newly cloned Complete-Fire-Red-Upgrade folder now by:
    cd Complete-Fire-Red-Upgrade

  • The first thing we'll do, is to fix or rather adjust the repositories that our project is tracking. Right now, if we use git remote -v, we'll see something like this:

    This is telling us that the only repository we're tracking is Skeli's, and the "keyword" we use to interact with it is called "origin". So, what should we do? Let's set a new URL for origin (the URL to our GitHub Repository). We'll do this by using:
    git remote set-url origin https://github.com/USERNAME/NAME_OF_YOUR_REPOSITORY
    The result should be something like this:

    With this, we're telling to our local copy of the CFRU that the new home for our project will be the URL we just set origin to.

  • But now, what happens when/if we want to pull any updates from the original CFRU repo? To address that, we'll track the original repository via git remote. That way we'll have our own home for our project in GitHub, and we'll also be able to pull stuff from CFRU at will. We'll do this by using:
    EXAMPLE: git remote add keyword link_to_the_repository
    "keyword" will be the word of our choice that will act as the shortcut to Skeli's CFRU Repository.
    "link_to_the_repository" will be the URL to it.

    In other words, something like:
    git remote add cfru https://github.com/Skeli789/Complete-Fire-Red-Upgrade
    That way, we could do
    git pull cfru master
    and stuff like that whenever we wanted (the master is the branch; the CFRU repo has only one branch).

    And just like that, we're basically done here.

[INCOMPLETE] 4) Using the CFRU with your ROM:
The CFRU can ideally be applied to a ROM only once. This means that all the editing, whether it be spriting, scripting, mapping or graphics modification, is done prior to applying the CFRU. This is to avoid having issues and bugs in your ROM, since the CFRU is an extremely heavy insertion that may cause oddities in your ROM if the ROM is edited after the CFRU being inserted. It is NOT recommended to edit a ROM which has the CFRU inserted in it.

With that warning out of the way, you can add any of the following relevant additions (this isn't necessary of course. You can simply skip these additions, do your own mapping, scripting, graphics editing etc, and jump straight to the next step).
The following are a list recommended add-ons created by other users of the PokéCommunity that for some reason or another, were chosen to be left out from this engine. If you choose to apply any of these, they should be applied prior to applying the engine.

General:
Music:


Notes
  • As I've said above before and before, do not edit the "test" GBA ROM you get.
  • A line with "//" on the front is commented. A line without "//" in the front is uncommented. "Comment out" means not to uncomment, but to comment it, so it's out of the ROM.
  • I've not added everything in this tutorial from the Document since it would be a waste of effort. There is much regarding CFRU in it's documentation. You will have to read the entirety of it to understand on how to use the CFRU to it's full potential.
  • If you've expanded the OverWorld table, in "src/character_customization.c" change "(NPCPtr*) 0x839FDB0" to the address your OW table takes.
  • If you've inserted new Battle BG's and have time enabled at the same time, the custom inserted backgrounds will not have anything wrong with them, since it is dynamic based for all battle backgrounds.
  • With the latest update, "#define FOOTSTEP_NOISE" in src/config.h does not work, whether commented or uncommented.
  • The "BPRE" DS-Style Pokémon Selection Screen is not compatible with the CFRU; additionally, if you used any of the other patches, in "src/config.h", uncomment "#define GEN4_PLUS_SELECTION_SCREEN".

Optional additions
Here is a list of things you can customize in CFRU if you wish. Note that a majority of CFRU's features are interlinked with other files. Additionally, many of its features are locked behind these files. Everything listed here can be edited to suit your own personal ROM needs:
Spoiler:
  • asm_defines.s
    Here is a list of defines for various ASM routines inserted by CFRU. If you are to manipulate the following:
    The Move Table, Species defines, the Item Table, or created New Item Effects.

    Then you must change this file accordingly!

  • bytereplacement
    Here is a list of various hex edits the CFRU will insert upon its use. You can add any hex values you want to this table as well.

  • assembly/data/attack_anim_table.s
    If you edit the available moves, you will also need to define the new order here, and create new animations for them. Animation data could be found in these locations:

    assembly/data/anim_background_table.s
    assembly/data/anim_background_graphics_defines.s
    assembly/data/particle_graphics_defines.s
    assembly/data/particle_table.s

    You can also point new moves to existing animations by setting: goto ANIM_(Move).

  • assembly/data/attack_description_table.s
    This is the table that points each move to their respective descriptions. If you add new moves, add to this as well. (Be sure to place them between Gen 8 moves and Z moves).

  • assembly/data/item_tables.s
    These are tables for items associated with battle moves and effects. Namely Natural Gift.

  • assembly/data/move_tables.s
    This is a collection of various tables dedicated to move effects- such as ban lists, or moves defined by abilities like Iron Fist, sound based moves, and other effects. If you added moves, look into these tables.

  • assembly/data/type_tables.s
    This is a table for the location of the type icons when the type icon image table is inserted or replaced.

  • include/constants/moves.h
    Ensure that this matches what is contained in the DPE repository.

  • include/constants/pokedex.h
    Ensure that this matches what is contained in the DPE repository.

  • include/region_map_sections.h
    This is where you define each map name included in your rom.

  • include/constants/songs.h
    This is where you define each song included in your rom.

  • include/constants/species.h
    Ensure that this matches what is contained in the DPE repository.

  • include/constants/trainer_classes.h
    Defines the list of trainer classes. Feel free to replace a few.

  • include/constants/trainers.h
    Defines special Trainer IDs and the list of trainer sprite images.

  • include/constants/tutors.h
    Ensure that this matches what is contained in the DPE repository.

  • include/new/dexnav_config.hv
    Configuration for DexNav settings.

  • include/new/dns_data.h
    Configuration for DNS settings. Includes tints, setting windows to change with time of day, etc.

  • include/new/trainer_sliding_data.h
    Here is where you declare various strings and battle scripts, including sliding trainers.

  • src/catching.c
    Here is where new PokéBalls and their settings are defined. Read CFRU documentation for more info.

  • src/config.c
    Everything can be edited freely.

  • src/dynamax.c
    Allows you to customize Dynamax settings such as level ranges, egg move chances, etc.

  • src/form_change.c
    Settings for form change. Edit at your own risk!

  • src/roamer.c
    Settings for roaming Pokémon locations.

  • src/set_z_effect.c
    Settings for the species specific special Z-Crystals. Change at your own risk.

  • src/trainer_sliding.c
    Defines for trainer sliding messages. Use the Unbound values for inspiration.

  • src/Tables/back_pic_tables.c
    Defines to set up tables to switch the player's back sprite and backsprites for multi battles.

  • src/Tables/ball_graphics_tables.c
    Settings for PokéBall graphics. If you add new PokéBalls, see CFRU documentation for more details.
  • src/Tables/battle_frontier_trainers.c[/b]
    Set up for battle frontier trainers. Look at Unbound and the CFRU documentation for more details.

  • src/Tables/battle_moves.c
    Attack data is contained here. If you add new moves, see this file.

  • src/Tables/battle_tower_spreads.h
    Sets up EVs, IVs, ability types, items, moves, ball type, etc, for trainers in the battle tower.

  • src/Tables/class_based_pokeball_table.c
    Class based PokéBall settings are contained here.

  • src/Tables/experience_tables.c
    Allows you to change the base exp of each Pokémon.

  • src/Tables/frontier_multi_spreads.h
    Set up battle frontier multi battle partner spreads

  • src/Tables/frontier_special_trainer_spreads.h
    Set up spreads for Boss Battles in the battle frontier

  • src/Tables/frontier_trainer_names.h
    Battle frontier trainer names contained here.

  • src/Tables/item_tables.c
    Edit pickup tables, fling damage, and item effects.
  • src/Tables/level_up_learnsets.c[/b]
    If you defined movesets expansion in DPE, ignore this. If not, modify this.

  • src/Tables/music_tables.c
    Music for trainer spotting, class based battle music, victory themes and wild encounter themes found here.

  • src/Tables/pokemon_tables.c
    Alternate forms, alt sizes, move effects, and battle frontier ban lists, etc. found here.

  • src/Tables/raid_encounters.c
    Raid battle encounters and rewards are found here.

  • src/Tables/raid_partners.h
    Raid battle partner settings found here.

  • src/Tables/terrain_tables.c
    Battle terrain settings are found here. Includes battle backgrounds.

  • src/Tables/trainers_with_evs_table.h
    Settings for the trainers that utilize EVs and IVs are found here.

  • src/Tables/type_tables.h
    Edit the type effectiveness tables if you wish.

  • src/Tables/wild_encounter_tables.c
    Edit morning, evening, and night encounters, as well as swarm encounters.

  • strings/ability_name_table.string
    Edits the text for Ability names. Shorten to 12 characters to be able to see them in G3T.

  • strings/attack_descriptions.string
    Edit move descriptions here, if you ever wanted to.

  • strings/attack_name_table.string
    Edit what the move names will look like in game.

  • strings/frontier_trainer_names.string
    How the names defined in frontier_trainer_names.h will appear.

  • vstrings/frontier_trainer_text.string
    Text said by battle frontier trainers.

  • strings/scrolling_multichoice.string
    Defines the text for scrolling multichoice boxes if you define them. It will break compatibility with vanilla FR. Read CFRU documentation for more details.

  • strings/trainer_sliding_strings.string
    Text for trainer sliding messages that were defined is located here.


Useful links
Closing notes / Credits
Hopefully this tutorial may have helped you understand a little bit more on how the CFRU works. This tutorial will be expanded: The coming update in this tutorial will complete the "Setting up the CFRU (second method)" segment and the tutorial will get a good deal of polishing.

Special thanks to:
Skeli and ghoulslash - For CFRU
Prof. Leon Dias - His ROM base helped me understand a bit more about CFRU; also for the "Optional additions" segment
PokéMew - Snippets of DevKitPro tutorial
Lunos - Permission to copy text from his tutorials



This tutorial applies to Windows users only.
Any specific confusion? Reach out to me on Discord: Spacewalker#8460.
Do not contact the authors of CFRU and DPE for the sake of this tutorial, since they have no part in this and may rightfully be confused.

Gavoca

Age 14
Male
Under Your Bed
Seen 6 Days Ago
Posted February 12th, 2021
347 posts
290 Days
Great Tut

embers

IonGlue

Male
Planet Earth
Seen December 17th, 2020
Posted December 16th, 2020
1 posts
10.4 Years
Just what I needed! Real good timing haha, thanks!

One thing I don't quite get is the order. If you add the CFRU as the last step, you avoid editing any shops, routes, battles, ect. to use new content after you are done with mapping, spriting, ect?

Quite new to this level of customizability and level of editing- since my last "real" attempt at rom-hacking was ~6 years ago.
Currently working on an essentials based fangame - always open to talk!

Spacewalker

Exploring the universe.

Age 15
Male
Multiverse
Seen 2 Days Ago
Posted 1 Week Ago
826 posts
1.7 Years
Just what I needed! Real good timing haha, thanks!

One thing I don't quite get is the order. If you add the CFRU as the last step, you avoid editing any shops, routes, battles, ect. to use new content after you are done with mapping, spriting, ect?

Quite new to this level of customizability and level of editing- since my last "real" attempt at rom-hacking was ~6 years ago.
You add it as it is; if I want to use a new flag that is added by CFRU's Save Block expansion, I'll add it normally, insert the CFRU in my ROM, and test on "test.gba".
Venezuela
Seen 17 Hours Ago
Posted January 7th, 2021
3 posts
3.4 Years
First of all, thx for this tutorial!
Now does it mean that I should start my hack first by making graphics, mapping, etc and then insert the CFRU & DPE last?

And the other thing. If I want to insert the DPE, I just need to insert it and directly inject the CFRU or is there any change that needs to be done before insert CFRU?

Spacewalker

Exploring the universe.

Age 15
Male
Multiverse
Seen 2 Days Ago
Posted 1 Week Ago
826 posts
1.7 Years
First of all, thx for this tutorial!
Now does it mean that I should start my hack first by making graphics, mapping, etc and then insert the CFRU & DPE last?
Nope, DPE should go with all the mapping/scripting/etc.

And the other thing. If I want to insert the DPE, I just need to insert it and directly inject the CFRU or is there any change that needs to be done before insert CFRU?
That depends on how you've edited the DPE. Vanilla DPE should work fine.
Male
Seen 4 Days Ago
Posted January 15th, 2021
11 posts
5.7 Years
Do not ever edit a ROM which has the CFRU inserted in it. My question is in your red highlight, so I normally edit my rom, Pokemon Fire Red (U) (Squirrels) in this base, Map, Sprites Trainer, Scripts, to insert the CFRU in the end.
But how am I going to test the codes that are active through the setvar like dexnav, double battle pokemon en route, etc?
Couldn't you do all the maps, routines and do the script part with the CFRU inserted so that there is no error in the script?

Spacewalker

Exploring the universe.

Age 15
Male
Multiverse
Seen 2 Days Ago
Posted 1 Week Ago
826 posts
1.7 Years
Do not ever edit a ROM which has the CFRU inserted in it. My question is in your red highlight, so I normally edit my rom, Pokemon Fire Red (U) (Squirrels) in this base, Map, Sprites Trainer, Scripts, to insert the CFRU in the end.
But how am I going to test the codes that are active through the setvar like dexnav, double battle pokemon en route, etc?
Couldn't you do all the maps, routines and do the script part with the CFRU inserted so that there is no error in the script?

As I said above:
You add it as it is; if I want to use a new flag that is added by CFRU's Save Block expansion, I'll add it normally, insert the CFRU in my ROM, and test on "test.gba".

Spacewalker

Exploring the universe.

Age 15
Male
Multiverse
Seen 2 Days Ago
Posted 1 Week Ago
826 posts
1.7 Years
Very nice tutorial! In the future, do you plan on adding stuff regarding the implementation of any specific features to give users a nice taste for how DPE/CFRU work in practice? For my part, I'd love a to see a step-by-step look at Pokemon manipulation via DPE since I'm struggling with that currently. Anyway, good job!
Playing around with the files for some time will give anyone an extensive understanding of how both work. You can view the Optional Additions bit as well.
For PKMN manipulation, however, you can use this (credits to Leon Dias):
https://www.dropbox.com/s/q7henr9o8yacvo4/Optional%20Changes%20In%20DPE.rar?dl=0
Seen 2 Hours Ago
Posted 2 Days Ago
649 posts
110 Days
Hey I created a tutorial for editing the dpe evolution table in hex maniac can you add that to your tutorial link list.
I've tested and it works without issue.

Just like the other things you have up, this is an edit that should be done before the cfru patch is applied.
The A-non Team



Trevenant
Lv. 100 @ 306
Points: 70
Challenge: Souls of the Damned
Legendary: TBA

Chandelure
Lv. 100 @ 213
Points: 100
Challenge: N/A
Legendary: Entei

Ponyta
Lv. 100 @ 497
Points: 70
Challenge: N/A
Legendary: Entei

Eevee
Lv. 100 @ 708
Points: 70
Challenge: TBA
Legendary: TBA

Budew
Lv. 100 @ 794
Points: 100
Challenge: TBA
Legendary: TBA

Seen 2 Hours Ago
Posted 2 Days Ago
649 posts
110 Days
Hello, great tutorial, thank you very much this was a great help to me, but I have a problem because I cannot add pokemons to DPE even with the files you gave.
You don't add pokemon to DPE it adds the pokemon. The only pokemon that can be added are the ones already listed by that program.
But you shouldn't need to add more as it adds all the way up to gen 7.

But that only puts them into the rom, [b]not[\b] in the game itself, you need to do that with advance map. or some other way.

But to see the new pokemon in advance map you need to expand it first. So open advance map in some hex editor, my preference would be hex maniac advance. Next goto the address 77DD5 (in hex press ctrl g and type 77dd5)

The two bytes there represent the max number of pokemon that program can identify. You need to change that to the reversed hex ID of the last pokemon you want in your rom, based on the ID's listed in the DPE file species.h

The very last pokemon added with dpe is Xerneas Natural form. which is 0x44D

I believe the method for reversing the hex value is known as little indian, but anyway using 0x44D as an example

you would change the bytes at the address 77DD5 to 4D 04

Pretty much you split the hex value into 2s adding a 0 in-front of any single value with out a pair. Then you reverse the order

so 0x44D then becomes 04 4D , finally we reverse it to become 4D 04. and that's what you put in at the address.


After you change that save and close, then open advance map, and go to wild pokemon, when you scroll down you should have all the pokemon that dpe added to chose from.

But remember advance map isn't the only way to add these pokemon, as they are already in the rom. You could probably do so with the C files in cfru or asm also. And if done that way you can have more control over who shows up when. Since most bases applied after dpe add day night and seasons. So you could set different encounter tables for day or night in the same location etc. if you used on of those instead of advance map.

I don't know how to do that yet so I just use advance map for now.
The A-non Team



Trevenant
Lv. 100 @ 306
Points: 70
Challenge: Souls of the Damned
Legendary: TBA

Chandelure
Lv. 100 @ 213
Points: 100
Challenge: N/A
Legendary: Entei

Ponyta
Lv. 100 @ 497
Points: 70
Challenge: N/A
Legendary: Entei

Eevee
Lv. 100 @ 708
Points: 70
Challenge: TBA
Legendary: TBA

Budew
Lv. 100 @ 794
Points: 100
Challenge: TBA
Legendary: TBA

Age 26
Male
United States
Seen 2 Weeks Ago
Posted March 10th, 2021
36 posts
6 Years
Thank you very much for the tutorial!

I got it all working and even managed to mess around with a few files in the CFRU to try and understand it and see if the outcomes I expected happened in the compiled rom and they did!

A few questions I have tho. How exactly does this iteration of the DNS function. Is it off of a set start time that ticks even when the game is off - or when its on only? Does it function off the time on the system running the EMU? If there's any sort of documentation on the DNS id love to read up on it more and see if its a right fit for my hack or not. I was interested in making some of my more rare/strong Pokémon appear as overworld encounters with their hidden ability on a specific day.

My biggest concern tho is what order I should be editing my rom. I understand I am not supposed to do any editing to an already compiled rom. So how do I manage to edit trainers and pokemon data. Wouldnt applying the CFRU overwrite any of those changes I make? I know it doesnt mess with map structure or scripts. So I should do all of that work prior to applying the CFRU/DPE.
Seen 2 Hours Ago
Posted 2 Days Ago
649 posts
110 Days
Thank you very much for the tutorial!

I got it all working and even managed to mess around with a few files in the CFRU to try and understand it and see if the outcomes I expected happened in the compiled rom and they did!

A few questions I have tho. How exactly does this iteration of the DNS function. Is it off of a set start time that ticks even when the game is off - or when its on only? Does it function off the time on the system running the EMU? If there's any sort of documentation on the DNS id love to read up on it more and see if its a right fit for my hack or not. I was interested in making some of my more rare/strong Pokémon appear as overworld encounters with their hidden ability on a specific day.

My biggest concern tho is what order I should be editing my rom. I understand I am not supposed to do any editing to an already compiled rom. So how do I manage to edit trainers and pokemon data. Wouldnt applying the CFRU overwrite any of those changes I make? I know it doesnt mess with map structure or scripts. So I should do all of that work prior to applying the CFRU/DPE.
You'll have to read the dns related C files in cfru for that. I do know that it is based on system clock, like the original handheld games.

And no applying cfru doesn't overwrite any changes you make, unless you put the place it loads the changes to in the make.py file in the scripts folder, where other data already exists.

So just check your rom for free space and put the dpe and cfru changes in places where there isn't data already.


Cfru is a C-injector so its uses methods that of both decomp (editing C files and compiling) and binary hacks (asm, and being able to directly edit with binary programs), you can make changes to your rom with the binary tools after you apply cfru, the reason I assume its recommended not to is some programs no longer work well with the expanded rom.

That said, if its just giving trainers the new pokemon, you can do that with the file created from dpe. But the best way to learn what you should and shouldn't do is just to try it yourself.
Just make a backup file before you try anything.
The A-non Team



Trevenant
Lv. 100 @ 306
Points: 70
Challenge: Souls of the Damned
Legendary: TBA

Chandelure
Lv. 100 @ 213
Points: 100
Challenge: N/A
Legendary: Entei

Ponyta
Lv. 100 @ 497
Points: 70
Challenge: N/A
Legendary: Entei

Eevee
Lv. 100 @ 708
Points: 70
Challenge: TBA
Legendary: TBA

Budew
Lv. 100 @ 794
Points: 100
Challenge: TBA
Legendary: TBA

Age 26
Male
United States
Seen 2 Weeks Ago
Posted March 10th, 2021
36 posts
6 Years
Thanks for the reply!

So I can still edit a rom with the hacking tools (I know I must edit the ini) after I have DPE inserted. Just not CFRU?

Visualizing the data im working with in G3T and Hopeless Trainer Editor helps me a lot haha.

The value of CFRU seems unmatched so if I have to do all my data editing in notepad I will xD
Male
Seen 7 Hours Ago
Posted 7 Hours Ago
258 posts
304 Days
^ Ditto to the above question. I'm wondering if you can edit movesets etc after inserting DPE. I can't imagine making half a hack then not being able to modify stats or moves if I made a mistake on a Pokemon lol
You cant, like if you open it on g3t after editing the ini, it’ll still read as glitched movesets

Spacewalker

Exploring the universe.

Age 15
Male
Multiverse
Seen 2 Days Ago
Posted 1 Week Ago
826 posts
1.7 Years
Thank you very much for the tutorial!

I got it all working and even managed to mess around with a few files in the CFRU to try and understand it and see if the outcomes I expected happened in the compiled rom and they did!

A few questions I have tho. How exactly does this iteration of the DNS function. Is it off of a set start time that ticks even when the game is off - or when its on only? Does it function off the time on the system running the EMU? If there's any sort of documentation on the DNS id love to read up on it more and see if its a right fit for my hack or not. I was interested in making some of my more rare/strong Pokémon appear as overworld encounters with their hidden ability on a specific day.
Apologies for the late reply, but you can find a segment for DNS on page 78 in the documentation. For time-based wild encounters, have a look at page 74.


My biggest concern tho is what order I should be editing my rom. I understand I am not supposed to do any editing to an already compiled rom. So how do I manage to edit trainers and pokemon data. Wouldnt applying the CFRU overwrite any of those changes I make? I know it doesnt mess with map structure or scripts. So I should do all of that work prior to applying the CFRU/DPE.
You can edit a ROM with the DPE, but not a ROM with the CFRU. CFRU shouldn't touch majority of the stuff you've edited, since it adds more stuff than it edits. But to clear your problems, 1) A lot of tools will be incompatible with CFRU; I suppose you could edit INI's and such, but I haven't tried it and 2) since the CFRU is an extremely heavy insertion; there are many things you can change dynamically like trainer sprites, OW sprites, scripts, region map data, every PKMN learnset, new items etc. In the end, its just a precaution/advice. You could simply insert it and make a game, but that kills the dynamic factor since you can change anything at any point if you want when following the recommended insertion steps in the doc.


^ Ditto to the above question. I'm wondering if you can edit movesets etc after inserting DPE. I can't imagine making half a hack then not being able to modify stats or moves if I made a mistake on a Pokemon lol
You can edit the movesets directly through DPE [src/Learnsets.c]. Also remember that you need to update src/Tables/level_up_learnsets.c in CFRU too.

Spacewalker

Exploring the universe.

Age 15
Male
Multiverse
Seen 2 Days Ago
Posted 1 Week Ago
826 posts
1.7 Years
Update #1
The tutorial has been updated with another method for setting up the CFRU. It is still incomplete and needs a lot of clarification. The whole tutorial will get a rundown and polishing in the next update. For now, it's just a step upwards to start working with the CFRU. Next update will hopefully be out in a few days.

OGProfRowan

Male
Michigan/Ohio
Seen 11 Hours Ago
Posted 1 Week Ago
4 posts
5.3 Years
Hi! Thank you for this. Just for clarification here, do we take a clean version of a FireRed ROM, apply DPE and anything else (for me, I'm considering DS Style Selection Screen + Sideways Stairs), work on the mapping, scripting, etc., and only after we are finished and ready to see/playthrough what we have, apply CFRU and play the test.gba?

Spacewalker

Exploring the universe.

Age 15
Male
Multiverse
Seen 2 Days Ago
Posted 1 Week Ago
826 posts
1.7 Years
Hi! Thank you for this. Just for clarification here, do we take a clean version of a FireRed ROM, apply DPE and anything else (for me, I'm considering DS Style Selection Screen + Sideways Stairs), work on the mapping, scripting, etc., and only after we are finished and ready to see/playthrough what we have, apply CFRU and play the test.gba?
That is correct.