• 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.

Development: Adding [a] new type[s] in gen 3?

  • 76
    Posts
    13
    Years
    • Seen Jan 12, 2012
    So I was wondering. Would it be possible to add new type(s) to Fire Red? It might be cool/useful to have a "Sand" type, or maybe a "light" type, wouldn't it? Well, after some research, I've been thinking of a way to do this. There is a type in gen II-IV that is barely used, namely the "???" type. In gen 3, it is only used for eggs and the move Curse. In my opinion, ??? type is a waste of bytes. Eggs should just be normal, and Curse should be ghost type (they did that in gen 5 and removed ??? type). Well, the main problems that I discovered are
    1. ??? has no type effectiveness
    2. Moves with the ??? type strangely always do very low damage.

    If these problems could be fixed,we could change the name and image for it and make a new type!
     
    It was possible... Just found by UNLZ-GBA a pointers of ATTACK GRAPHIC and add CRYSTAL <Or somewhat type you want> Whithout ???. Also change in text <By YAPE 0.9> From ??? to CRYSTAL (or another) Name... Also by Attack editor change type of Curse from ??? to GHOST... And presto. New Type Add... I use this <Adding Crystal> To my hack named Pokemon Dirty Sun.
     
    It was possible... Just found by UNLZ-GBA a pointers of ATTACK GRAPHIC and add CRYSTAL <Or somewhat type you want> Whithout ???. Also change in text <By YAPE 0.9> From ??? to CRYSTAL (or another) Name... Also by Attack editor change type of Curse from ??? to GHOST... And presto. New Type Add... I use this <Adding Crystal> To my hack named Pokemon Dirty Sun.

    But that doesn't change anything other than the type's name.

    You need to set the type effectiveness; you're probably going to need to find where the game stores type effectiveness, and either repoint it to add ??? type in, or fix ???'s data (idk which, i've never looked).

    As for the damage, that's probably because the ??? type is never used for attacking, and may not have the same data as the other types in terms of a "standard" type. I'll try to look into what we can do...
     
    the ??? type's index number is between the physical and special types so the damage code doesn't know what to do, thus it does 1 or 2 damage

    using a physical/special split hacks will let you create ???-typed attacks that can do damage normally
     
    But for good look inside your game... You can only change graphical and text entries of types... Also i have Idea about EGGS... What type for Eggs? Simple... Normal... And you can freely change the ??? type into the extra one.
     
    Its possible to do this simply by extending the battle types table in the rom. But you'd also have to: redraw and extend the graphic that has all the type "boxes" and edit that routine. You'd have to hack the loader as for the battle type table as well. Finally, you'd have to hex edit any pokemon with the new type manually, because there are no editors that would support it currently. That's a hassle and gets messy fast, but its perfectly doable.
     
    Its possible to do this simply by extending the battle types table in the rom. But you'd also have to: redraw and extend the graphic that has all the type "boxes" and edit that routine. You'd have to hack the loader as for the battle type table as well. Finally, you'd have to hex edit any pokemon with the new type manually, because there are no editors that would support it currently.

    Or, even worse, they don't have a type table and it's all based inside a routine. :O
    Also, the fact that most ASM hacks don't go too far because programs won't support them could be fixed extremely easily: open-source coding!

    Unfortunately, all the code devs on this site seem to be either not willing to share their code, or they make a tool and then loose the code (me). Also, if they were open source, it'd make porting to Mac OSX and Linux a ton easier for the people and developers of the tools. (An example, when NSE 2.x's source was released, I managed to port it to Mono, which makes it possible to run on Mac and Linux.) Also, if a new hack arises, someone can fork a project to add it, and then have it merged into the main project.
     
    I agree. Stingy devs often lead to halt in progress. Now, I'm not one to advocate for avoiding hex editors, but I think having tools do the calculations usually ends better than me doing the calculations to find my locations in and entering the data myself in a hex editor. As that leads to a fatter margin for error...
     
    So, last night, I worked out how type effectiveness is done in FireRed. You'll be pleased to know that it's relatively simple. Firstly, the method of storage:

    Code:
    [Attack type - 1 byte][Target Type - 1 Byte][Effectiveness value - 1 Byte]

    This data is stored at 0x24F050.

    There are several of these, kept in an array which ends with a 0xFE value. The game loops over each entry in the array, checking if the attack type matches the used attack's type, and if it does, then checks the Target Type against the 2 types of the targeted Pokémon.

    If either type matches, it loads the effectiveness byte and branches off to another routine which takes care of physically making the attack super effective/not effective. The type effectiveness values are as follows:

    Code:
    [B]Note, these are in hex[/B]
    00 - Has No effect (Eg, Ghost on Normal)
    05 - 50% effectiveness
    14 - 200% Effectiveness

    These values are used as they represent 0%, 50% and 200% respectively of 0xA (10). The gamd multiplies the calculated damage by whatever value is present after working out type effectiveness, and multiplies the current damage value by it. It then divides by 10, this giving us a satisfactory answer.

    In essence:
    Code:
    private short TypeEffectiveness (short existingDamage, byte attackType)
    {
        byte value = rom[0x24F050];
        int counter = 0;
        while (value != 0xFE)
        {
            if (value == attackType)
            {
                for (int i = 0; i < 2; i++)
                {
                    byte targetType = ram[0x2023C05 + (ram[0x2023D6C] * 0x58) + i];
                    if (targetType == rom[0x24F050 + counter + 1])
                    {
                        byte effectivenessValue = rom[0x24F050 + counter + 2];
                        ChangeEffectiveness(effectivenessValue, existingDamage);
                    }
                }
            }
            counter += 3;
            value = rom[0x24F050 + counter];
        }
        return existingDamage;
    }

    Hopefully, that high level language recreation will help explain what it does.

    What you may gleam from these values, however, is that, unless explicitly told otherwise, the game treats all moves as normal effectiveness on any type.

    If neither type matches, it jumps to the loop counter, increments it and continues checking until it hits that magical 0xFE value.

    However, the way it is implemented leaves something to be desired as it is very slow (looping over several entries), and taking up more space than needed, both in terms of code and data. It's obviously wasteful in so far as it continues to check even after having already found both effectiveness values, as well as the wasteful nature of the loop in and of itself.
     
    Last edited:
    -WARNING-, kinda not that long post that's long

    Okay, so, to test a theory of mine, I decided to see if I could just change a Pokemon to a 19th type, without doing anything else to the rom. And the result:
    [PokeCommunity.com] Adding [a] new type[s] in gen 3?


    So in theory, we would not need to edit any table, if any existed. I'll experiment some more, and see if I can successfully implement them into the game.
    If this works, we would need to repoint the effectiveness table, and the picture of the type icon, to expand the number of type icons. But, with what to do with the "-type-" icon, I'm not sure.

    -EDIT-
    Okay guys, so I inserted this new type icon thingy:
    [PokeCommunity.com] Adding [a] new type[s] in gen 3?


    This new picture is 2 blocks bigger in height. In theory, this would affect the "Type", "Power" icons, the game uses the original pointer.

    [PokeCommunity.com] Adding [a] new type[s] in gen 3?

    [PokeCommunity.com] Adding [a] new type[s] in gen 3?

    (ignore the new attacks please)

    So I guess, this is a success? Of course, I still have to experiment with attacks. I'll re-edit this later.

    -EDIT TWO-
    Okay guys, I have edited the attacks.
    So, I edited the type to be not very effective against Grass. So this is the result:
    [PokeCommunity.com] Adding [a] new type[s] in gen 3?
    [PokeCommunity.com] Adding [a] new type[s] in gen 3?
    [PokeCommunity.com] Adding [a] new type[s] in gen 3?


    So its a success!
    [PokeCommunity.com] Adding [a] new type[s] in gen 3?
    - I also edited the type name as you can see.

    But there's a problem:
    [PokeCommunity.com] Adding [a] new type[s] in gen 3?

    I'm not exactly sure if this is a side-effect of the addition of a new type, but I'm not sure.

    So, in short, adding new types is possible without editing any tables, if any exist
     
    Last edited:
    Okay, I'm going to double post.
    So, after some more research, I have concluded that you can 23 total types without the use of ASM.

    This is because, originally, the type icon bitmap is 16 blocks by 16, so the game registers the new type icon bitmap as only 16 x 16, no matter how large it is. Also, due to the locations of the "Type", "power" and other icons, you have to add new icons with a space before adding another one. As you can see, you can only have a total of 23 icons on the 16 x 16 bitmap, including the 2 pokeballs at the top.

    So, looking through the rom, I can see that the locations of the ASM for the type icons is at 0x8107D68, which then branches to an extremely ugly, long and scary ASM which I believe indicates which parts of the bitmap are the type icons.

    Unfortunately, I'm terrible at ASM, but I'll try.
     
    But there's a problem:
    [PokeCommunity.com] Adding [a] new type[s] in gen 3?

    I'm not exactly sure if this is a side-effect of the addition of a new type, but I'm not sure.



    I think its not the "side-effect-thingy" like you think, the "1m sub-circuit board blabla" message sometimes appears whenever i open a Pokemon Fire red rom, without a save file, BUT with a .sav file

    Its usually appears too whenever i'm trying to load a .sps file(Gameshark Save file)

    I don't know what that's mean though, but i think it has nothing to do with it.

    Btw, so, are you successfully added a new type? if so, can you post a tutorial about it?
     
    Okay guys, due to my low knowledge in ASM, I don't believe I can make new routine at the moment.
    So as of right now, you can only create a total of 24 types.

    To do this, you're gonna have to insert something like this into free space:
    [PokeCommunity.com] Adding [a] new type[s] in gen 3?
    (ignore the double 'wood' type)

    Make sure the height and width are divisible by 8.
    Then, just repoint to the new location that you placed it in, and you have inserted the icons.

    Remember, when you're editing pokemon/attacks, you can no longer use any Editors as they do not support the new types, and you'll have to hex edit everything.
    Then just add new strenghs/weaknesses by repointing the table at 0x824F050.
    And if you're picky, you can repoint the data at 0x824F1A0 and edit the names of types when using moves. Just add 00 00 before the name.

    Now just so you know: the bytes for the new types are: 0x12, 0x13, 0x14, 0x15, 0x16 and 0x18
    0x17 is skipped for some reason. Also 0x18 is the top type, with the others at the bottom following ???.
     
    Can this thing be done in Pokemon Ruby\Sapphire?

    I've used UnLz GBA and I watched the tile with inside the Types, and I've found also the contest types (like Cool, exc.), but there's not enough space in the Pic to add new types, what can I do then?
    There's a method to expand the Image and insert new types ?
    How I can set the types' weakness & where are the pointers 4 that?
    (sorry if some of my question are horribly n00b, but I used UnLz GBA only a few times & I started doing Hex Editing only in January).

    Anyway Wood, Wind, Gas, Abnormal & Light are great types,
    what about Sound & Love types?
    (for example, Exploud has sound-type & Luvdisc or Chansey has Love-type).
     
    To be honest, your not going to find a lot of support from ASM hackers for Ruby because it's engine is extremely messy. If you like the Ruby feel but want more support, use Emerald, because it is more similar to the FireRed engine and will have a bit more support for these kinds of things.
     
    Last edited:
    hahah alreay addded fairy type to my hack(emerald hack)
    (replaced the ??? type)
    just edited the type resistances to make the fairy type
    a real type
    made fairy type effective to dragon
    made fairy type unaeffective to dragon
    made fairy type eefffefctive to poison
    made dragon type uneffective to fairy
    made fighting type effective to fairy type
    made posion type uneffective to fairy
    simple eh?
    btw i edited the type resistance using type resistance
    google it
    hopefully you find the program
     
    hahah alreay addded fairy type to my hack(emerald hack)
    (replaced the ??? type)
    just edited the type resistances to make the fairy type
    a real type
    made fairy type effective to dragon
    made fairy type unaeffective to dragon
    made fairy type eefffefctive to poison
    made dragon type uneffective to fairy
    made fighting type effective to fairy type
    made posion type uneffective to fairy
    simple eh?
    btw i edited the type resistance using type resistance
    google it
    hopefully you find the program

    The problem with doing that is, the ??? type controls struggle.
    Struggle has to be neutral to everything. Therefore now with those
    type changes, when you run out of PP and struggle you will do odd
    damage.
     
    Back
    Top