• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Tool: How to get DPE expanded evolution table into HexManiacAdvance for quick easy edits.

853
Posts
3
Years
    • Seen Nov 9, 2023
    Alright a few things before I get started, you are meant to do this, after you've expanded your rom with dpe, but before you apply any other patch/base such as CFRU or leon's ultimate base.

    The reason this tutorial is important is, that all evolutions are predefined, in dpe, if you want to edit them you'd have to do so in your dpe files by changing the C code, which isn't very easy and is quite time consuming. Especially in the case of pokemon that don't normally evolve as you'd have to add them to dpe's listing before you could even edit them, and for us that don't know decomp none of that is an easy task.

    Plus you'd have to make any changes before you compiled, so if you decided you wanted to change something, you've have to toss your made file, re-edit the data, and then compile again.

    If you've been applying multiple scripts to that file, understandably you wouldn't want to trash it, as that would mean completely starting over.
    Being able to edit evolutions in hex manaic means, the freedom to make all the adjustments you need, without having to give up progress.

    Necessary Files
    Throughout this tutorial you'll need to rely on data from several different sources, in the DPE root, open your "offsets" file that will tell us where all the data we want to change is.

    Next from the root goto include, and open your "species.h" file this will both a list and a count for all the pokemon added with dpe, at the bottom of the file
    you see the define for number of species is the last plus 1. Here that's 0x4ef +1. that's a number we'll be using later in hex data.pokemon.names

    While in the include folder open "evolutions.h" this shows all the different evolution methods, here you see "none" equals 0, it doesn't show it but each individual method is increasing by 1, now look where "level" is, if you count it, that would be shown as 0x4. Keep that in mind for later.

    Now go back to your root(master) folder and go to src folder, and open "Evolution Table.c" this the actual table with all the evolutions and the format it will be displayed in within the data when we look in hex.

    I believe that's all the files we'll need for this tutorial but, if you ever get confused about something I've described or failed to describe, go to the bottom of the tutorial where I've linked my discussion with haven (the creater of HMA) over on discord, It covers him explaining somethings to me, and me showing how I came to make the adjustments to get things working with a few extra images as well.

    Preface
    You'd could definitely do what you need with just that, but following the tutorial will be to help you understand why it works, and how to better work in hma.

    Oh you will also need the .Toml file (where hex maniac stores all its file info) for the rom you're going to be working with, if you don't already have a .toml for your dpe expanded rom, as soon as you open it with HMA for the first time one will be made so don't worry.

    Now something you must keep in mind, to edit anything in hex maniac it must already be "defined" in this case that means the data for it must already exist in some form. Now in hex maniac that usually means you need to start with a name.

    If you want a new move, you add on to the move names table, if you want a new type, you add on to the type names table, etc.

    In our case we're dealing with pokemon so we need to start at the pokemon names table.

    But before we can even get started on the evolutions we need get hex ready to read all of our pokemon data expanded from dpe.

    So open your expanded rom in hex & goto data.pokemon.names if you have trouble finding the data that way, instead goto your dpe offsets file and search "Name_bulb" to find the name data for bulbasuar and copy the offset there. as he is the first pokemon in the dex, that should take you close to the top of the table we're looking for.

    Go back to hex maniac advance and press ctrl+G to open the goto prompt and paste in that bulbasaur name offset.

    Alright once there get to the top of the table. (quick tip moving to the first entry or last entry in any table in hex, is as simple as clicking any entry within the table and pressing "home" or "end" on your keyboard. depending on your keyboard you may need to press a FN function key with it to work.)
    You should see a string of question marks ?????? this the first entry of the table the place holder pokemon 0 entry.

    Now once at the first entry of the table you should see a change at the top of your window, you should see a display that says "Anchor:
    with the table name and several other values behind it. Like so ^data.pokemon.names[name""11]126

    Let me break it down, ^ is the symbol for the anchor. Following that is the anchor name, the default is that of the table.
    the info in brackets is telling us that each name value is made up of a string of max eleven characters. (characters is probably the wrong term but you get it)

    Now what's important here is the number at the very end, that tells us how many rows are in our table, i.e how long it is.
    Your number will be different than what I have there, that's just something i put up.

    The data for all the pokemon you added is already in the rom, but right now hex can't read it , because it doesn't know the data is there, and the table needs to be expanded. Now before we do that I want to show you how to know the name data is there.

    Now go to the end of your name table. Now scroll down until your last formatted data entry is about half way up the window.
    Below your table you should see a bunch of random data with a bunch of free space at the end, "FF". Now remember what I said about the data in this table, that the name data is max eleven chracters long (I remember now that's not characters but an eleven bytes long data string)

    Look at the formatted data in your table, even though its formatted in a way you can read, remember that everything is actually hex data, so even those letters are actually representations of hex. Now right click on the formatted data and then click "clear format".

    As you can see, that data in your table suddenly looks a lot like that random data outside the table, that's because those are pokemon names too. Now press Ctrl+z to get your formatting back, and go to back the top of the table.

    What we need to do is expand our table so it covers all those added pokemon that means we need to increase that last number in our anchor data by the number of unaccounted for names in the data.

    ^data.pokemon.names[name""11]126 this bold part here.

    But meister_anon, you say, that's a lot of data I don't want to count all that.

    Good me either, and luckily you don't have to, unfortunately I didn't realize this so I actually did.
    Remember when I said to keep in mind the 4ef+1 that we saw in our species.h file? Here's where that comes in handy.
    4EF is the hex representation for the total number of pokemon added with dpe, the total number of species.
    That +1, is to account for the entry 0, placeholder pokemon.

    In hex press Ctrl+H to bring up the hex to deci converter, and type in 4EF see what that gives us.
    1263. Nice. now add our plus one and the total length of our table should be 1264 entries.

    So in our anchor change your last value to reflect that, so it should now look like so,
    ^data.pokemon.names[name""11]1264

    After you press enter to lock in the change, click on the table, and go to the very end, it should be much further down now, and the last entry added by dpe,as of this writing, should be Urshifu~4. Double check your table view dialogue and it should show as value 1263.

    If you've got that now save.

    Step 1 is complete. and as a side benefit you should have access to all of the new pokemon data (excluding evolution & learnsets) from the table dialogue.

    We needed to do that first because the next part relies on the pokemon.names table.

    Step 2.
    Ok I forgot one other file we need, so make a .toml from a clean unexpanded fire red rom (or whatever rom you're using)

    Alright, you can close hex maniac for now, from here the rest of your edits need to be made in the .toml file so open both your expanded toml and the .toml from the clean rom. in notepad or whatever program you're using. (It's always a good idea to make a backup so if you want to put a copy somewhere of the expanded rom .toml you just made all those changes to go ahead and do that now)

    Alright first go to your UN-expanded clean rom, and search the word "evo" the first thing that comes up should be your default evo table in hex. data.pokemon.evolutions copy the entire function you see there, so that's the [[named anchors all the way to the end of the format string. To make it easier select to the line under format to make sure you get the entire thing. After you have everything selected ctrl+c to copy, [Notice that the table above is data.pokemon.stats]

    Next go over to your expanded rom and search pokemon.stats , now below that is where the evo table should be but cleraly isn't.
    So what you need to do, is go to the blank line below the stats function. press enter twice to add another 2 lines,
    go down 1 and paste your evo data. That should put everything in proper spacing, you should have one blank line above your data.
    And one blank line below your data before the next function starts.

    Alright now save, at this point we've added the evo table back into hex, but we need to change the format to expand the table for what dpe added. As well as change the address to reflect where our data actually is.

    *
    Forgot another file, but in your dpe root folder (the master folder) if you open special_inserts.asm file,
    at the top you see it says evos_per_mon is 16, which is much higher than the default of 5.

    Think of it like this, that evos per mon is maxed to gen 3 eevees evolutions, one pokemon eevee.
    Can evolve into flareon, jolteon, vaporeon, umbreon and espeon. That's 5 evolutions to that one pokemon.

    DPE expanded this to sixteen and so our evolution table must be reformatted to show this.

    Step.3
    Now open the dpe offsets file again and search, evolutiontable as I have it without space.

    Little background information; normal offsets have at max 6 characters usually, but if its a pointer than it may start with 08(offset) and then have the rest of your offset.

    Since the rom is expanded your data is going beyond the normal range of typical offsets (least how I see it) so in my case, my
    evolutiontable offset was listed as 09B179D0 (yes that's a zero there are no O's in hex) when you put that into hex maniac it instead takes me to 1B179D0, so if your address is similar and you have a 09 in front of the normal 6 digit offset, copy the offset, but substitute a 1 in place of the "09"

    (If its different but still longer than 6 digits, just paste it into hex as it is, and see where it takes you, you'll want the address you actually land it.)

    If you want you can open your expanded rom in hex manaic and go to that address you just copied so you can get an idea of what your data looks like. what you should see is a lot of 00s. the value 04, some spaces the number 10, more spaces and I think the number 02.
    Then a lot of zeroes and then the next entry is something vaguely similar.

    This is where your evolution table.c is useful, if you open that it shows the format for your evolution table, since there is space for 16 evolutions per mon, each pokemon entry has 16 strings of data to account for another evolution listed before you go the next pokemon.

    In your evolution table.c you can see the format is loosely "evolution method" (remember earlier that evolution by levelup was method 04 in your evolutions.h file) next is the byte's relevant to that evolution method, if its level up, then you'll have the hex value for the level to evolve
    then the value for species number of the pokemon you're evolving into. then some extra bytes at the end.

    All in all each evolution string is 8 bytes long. After the 8 bytes it repeats for the next possible evolution for that mon, so there are 16 instances of that 8 byte string for each mon.

    How did I get to that, well you can check it yourself, in hex maniac in the same line where you see the first 04, highlight the entire row, and every row after until you're just below the next 04.

    Since 04 is evolution by level up the space between the first one and the second one, is all the evolution data for one pokemon to the next. specifically bulbasuar up to ivysaur.

    All the 00's before that first 04 are for the placeholder pokemon so obviously everything is a 00. as it doesn't exist and doens't evolve.
    Now at the bottom of the screen hex maniac should show how many bytes you have selected if you did it right, there should be 128
    bytes selected. Now remember we have 16 evos per mon, and this should all be 1 pokemon, so divide 128 by 16, to see how many bytes are in one evolution string.

    128/16=8 So each pokemon's evolution data with 16 evolutions per pokemon should be 8x16 (pretty much. just another way of saying one evolution is 8 bytes long, and there are 16 of those, between each pokemon.
    Close Hex Maniac Advance

    Now go back to your expanded rom .toml file and change the listed address for our evolution table, to match the one from our offsets file.
    with 1 in place of 09 if it applies to you.

    Save that. At this point your table should still look pretty janky since its still formatted for 8x5 and not 8x16.

    As you can see in the format file it goes method1: arg1: species1: extra1: each of those takes up 2 bytes and make up the 8bytes string for one evolution. Following that line to the end you see it only goes up to 5, and after the closed brackets it says

    ]data.pokemon.names'''

    this part means the table is built using the data from our pokemon names table, that's why we had to expand that first, now once we finish here it will show all the evolutions for all the added pokemon not just the base ones that were in our original pokemon names table.

    Alright selecting this correctly without the program moving to the next line is a s.o.b, so instead of trying to mouse drag, scroll to the end of the line, click the space just inside the close bracket, (so the end bracket should NOT be within your selection)

    Scroll all the way back to the front of the line, hold down the shift key, and then click just inside the open bracket. to select everything.
    (Once again the bracket should NOT be within your selection)

    Press ctrl+c to copy.

    now to make sure you did it correctly right click and open another instance of notepad or word or whatever and paste it there.
    it should come out like this.

    method1:evolutionmethods arg1:|s=method1(6=data.items.stats|7=data.items.stats) species1:data.pokemon.names unused1: method2:evolutionmethods arg2:|s=method2(6=data.items.stats|7=data.items.stats) species2:data.pokemon.names unused2: method3:evolutionmethods arg3:|s=method3(6=data.items.stats|7=data.items.stats) species3:data.pokemon.names unused3: method4:evolutionmethods arg4:|s=method4(6=data.items.stats|7=data.items.stats) species4:data.pokemon.names unused4: method5:evolutionmethods arg5:|s=method5(6=data.items.stats|7=data.items.stats) species5:data.pokemon.names unused5:

    if you're in notepad that'll be one really long string. Actually looking at this, it seems it may actually be best to copy into the pokecommunity comment box, because this is wrapped quite nicely.

    Alright here's what you do paste that into the comment box below and we'll edit from there. We're going to paste it 3 times so have a total of 15 strings.

    You can probably tell where I'm going with this. Select and copy the last row, and paste one more time to the end to give us 16.

    Now we just need to change the numbers after method, arg, species, and unused to count from 6 to 16.
    Remember above is copied from my fire red rom's .toml, so if yours looks different that's why.

    Anyway after changing only those numbers, select and copy the whole thing, we're going to paste that back within the brackets.

    So go back to your expanded .toml file where the format is for the evolutiontable, do like before and click within the bracket (inside) scroll to the other end hold down the shift key, and click again to highlight everything within. Then just ctrl v pate, and our long string should take the space.

    So the last values you should see within the bracket should be something like this.
    method16:evolutionmethods arg16: species16:data.pokemon.names extra16: (but with those other parts for items etc. I just haven't added that to mine yet as of time of writing. Wanted to get this tutorial out to people)

    SAVE. Now your table is pretty much complete, except for the full listing of new evolution methods.

    So last thing to do is , open your evolution.h file where all the evolution methods are listed. *hex maniac has some different names for some, so don't worry about that, just add on the ones that aren't already there.

    We need to add the new ones on. so there are about 17 new evo methods. Go to your expanded rom .toml
    and search "evolutionmethod" to get you to that part of the list.
    Go to the bottom and copy the last method which should be beauty. copy the whole thing apostrophes and all

    '''Beauty'''

    Press enter to go down a line, then press paste to add a new evo method above the close bracket, do that 16 more times.

    Then just double click the name to select it, and replace the extra beauty's with either exactly what's listed in the evolution.h file
    or whatever equivalent name you come up with for the new evo method.

    After you finish, make sure you didn't accidentally replace the original beauty method, or your list will be off
    and the new mehtods won't work right, (because the hex value won't match the name)

    So in the toml
    the old values should end with '''level but new pokemon''' & then '''Beauty'''

    After that should come the new values starting with rain fog ow

    After the check delete any extra beauty's at the bottom. Scroll down evolution.h until you see


    #define EVO_GIGANTAMAX 0xFD
    #define EVO_MEGA 0xFE

    You see these are listed in the data as 0xFD

    and 0xFE

    But that's far from our evo method values as our first one starts at 0. Specifically the entire list starts with.
    0 = [

    That tells the .toml that the first value we write there will be starting from 0.
    After the close bracket after the last new evo method we added
    press enter to add a new line

    And there tell it what our start value is going to be, and open a new bracket.
    0XFD translates to 253 so what you need to write is

    253 = [
    then follow the same format as the first part of the list.
    Go down one line, go 3 spaces from the left wall, and type our text value between ''' '''' 3 apostrophes. 3 in the front and 3 in the back.

    Put your close bracket on the next line, and make sure there is a blank line after. before where the next list starts.

    So mine looks like this.

    [
    • ]
      Name = '''evolutionmethods'''
      0 = [
      '''None''',
      '''Happiness''',
      '''Happy Day''',
      '''Happy Night''',
      '''Level''',
      '''Trade''',
      '''Trade Item''',
      '''Stone''',
      '''Level High Attack''',
      '''Level Attack matches Defense''',
      '''Level High Defense''',
      '''Level Odd Personality''',
      '''Level Even Personality''',
      '''Level And New Pokemon''',
      '''Level But New Pokemon''',
      '''Beauty'''
      '''Rain or Fog''',
      '''Lvl & Type in Party''',
      '''Map Evolution''',
      '''Male & Lvl''',
      '''Female & Lvl''',
      '''Level Night''',
      '''Level Day''',
      '''Lvl Up w Hold Item Night''',
      '''Lvl Up w Hold Item Day''',
      '''Learn Move''',
      '''Lvl w Specific Pokemon in Party''',
      '''Lvl @ Time Range''',
      '''Critical Hits in Battle''',
      '''High-Key Nature''',
      '''Low-Key Nature''',
      '''Survive damage move to location''',
      ]
      253 = [
      '''GIGA''',
      '''MEGA''',
      ]

      You can write whatever you want here, it doesn't change the effect, that's hard coded in, this is all to add the formatted text that makes selection and reading so much easier.

      Well that's it, all steps done, and down below I have a link to my comments where I discovered all this on the Hex Maniac Advance Discord.
      If you follow the link you can see some images to go along with my direction. Good luck and thanks for reading.

      Resources & Notes from HMA Discord
     
    Last edited:
    853
    Posts
    3
    Years
    • Seen Nov 9, 2023
    Recently remembered I made this, and quick update this is still relevant, but haven in the HMA discord let me know there may be some points I missed.
    The convo can be found here, when I have time, and understand it better I'll try to update this post.

    But for now just check it out there.
     
    Back
    Top