PDA

View Full Version : Adding [a] new type[s] in gen 3?


lolwhet
November 9th, 2011, 06:57 PM
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!

Crimson5M
November 14th, 2011, 06:28 AM
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?

We have those. They're called Ground and Psychic.

Ksiazek Bartlomiej
November 7th, 2012, 08:14 AM
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.

itman
November 7th, 2012, 03:04 PM
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...

Agastya
November 7th, 2012, 03:08 PM
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

Ksiazek Bartlomiej
November 8th, 2012, 10:16 AM
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.

NintendoBoyDX
December 8th, 2012, 03:45 PM
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.

Shiny Quagsire
December 8th, 2012, 05:51 PM
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.

NintendoBoyDX
December 8th, 2012, 09:09 PM
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...

Jambo51
January 29th, 2013, 02:15 AM
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:

[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:

Note, these are in hex
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:
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.

ShyRayq
January 30th, 2013, 12:01 AM
-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:
http://i1343.photobucket.com/albums/o791/ShyRayq13/b1_zps6193792f.png

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:
http://i1343.photobucket.com/albums/o791/ShyRayq13/Status_zps27d9a749.png

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

http://i1343.photobucket.com/albums/o791/ShyRayq13/b2_zpsed25408c.png
http://i1343.photobucket.com/albums/o791/ShyRayq13/b3_zpse9fa9afc.png
(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:
http://i1343.photobucket.com/albums/o791/ShyRayq13/b4_zps1df20cc3.png http://i1343.photobucket.com/albums/o791/ShyRayq13/b5_zps16f723d4.png http://i1343.photobucket.com/albums/o791/ShyRayq13/b6_zpsdf61dfe3.png

So its a success!
http://i1343.photobucket.com/albums/o791/ShyRayq13/b45_zps930fe9cd.png - I also edited the type name as you can see.

But there's a problem:
http://i1343.photobucket.com/albums/o791/ShyRayq13/b7_zps74db0846.png
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

ShyRayq
January 31st, 2013, 01:53 AM
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.

Garuga17
January 31st, 2013, 02:26 AM
But there's a problem:
http://i1343.photobucket.com/albums/o791/ShyRayq13/b7_zps74db0846.png
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?

ShyRayq
February 1st, 2013, 10:52 PM
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:
http://i1343.photobucket.com/albums/o791/ShyRayq13/Statusyup_zps7d092ab1.png (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 ???.

80C
March 17th, 2013, 01:01 PM
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).

Ksiazek Bartlomiej
August 8th, 2013, 04:49 AM
I ask also about adress of RUBY types. I need it to add three types. CRYSTAL, MIST and LIGHT.

Shiny Quagsire
August 8th, 2013, 10:55 AM
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.

Ksiazek Bartlomiej
August 8th, 2013, 11:55 AM
But when I asked about every Pokemon Emerald routine adresses noone gave me them. I need routines of Pokemon Cries, Dex Entries and Types. Meybe you can help me.

supersoursky
August 8th, 2013, 03:48 PM
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

MrDollSteak
August 8th, 2013, 11:04 PM
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.

Ksiazek Bartlomiej
August 8th, 2013, 11:56 PM
Someone can give Name <Or better link> To that program which edit Types?

Chrisario
October 6th, 2013, 06:55 AM
How do I edit types because want to add Fairy Types

JordanB500
November 8th, 2013, 09:23 AM
lol i searched everywhere to find a page liek this i am just wanting to make one type and just wondering cant you make struggle be a normal move? i just want to know where i go in unlz-gba to find the type chart ive heard its 1485 for ruby but i dont remember what it is for emerald could this be it

http://s2.postimg.org/nf10vxd4p/Type_Table_recolor.png

Unfortunately i cant find the proper pallete for it

TheShinyMew
December 8th, 2013, 11:30 PM
-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:
http://i1343.photobucket.com/albums/o791/ShyRayq13/b1_zps6193792f.png

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:
http://i1343.photobucket.com/albums/o791/ShyRayq13/Status_zps27d9a749.png

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

http://i1343.photobucket.com/albums/o791/ShyRayq13/b2_zpsed25408c.png
http://i1343.photobucket.com/albums/o791/ShyRayq13/b3_zpse9fa9afc.png
(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:
http://i1343.photobucket.com/albums/o791/ShyRayq13/b4_zps1df20cc3.png http://i1343.photobucket.com/albums/o791/ShyRayq13/b5_zps16f723d4.png http://i1343.photobucket.com/albums/o791/ShyRayq13/b6_zpsdf61dfe3.png

So its a success!
http://i1343.photobucket.com/albums/o791/ShyRayq13/b45_zps930fe9cd.png - I also edited the type name as you can see.

But there's a problem:
http://i1343.photobucket.com/albums/o791/ShyRayq13/b7_zps74db0846.png
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

That's a very nice one. Now you can teach us how to insert types on Fire Red next time you make a new thread!

Leafbarrett
January 25th, 2014, 06:02 PM
So are there any plans for patches for this, or at least a tutorial for Emerald?

Shiny Quagsire
January 25th, 2014, 08:47 PM
So are there any plans for patches for this? Because sorry, I can't hex edit. Literally every time I've tried (not hyperbole), all I've managed to do is screw up the game.

9 times out of 10 if you ask for a patch in the Research and Development forum you're not going to get one, just so you know. This is usually because this stuff requires a knowledge of ASM and cannot be inserted easily without messing up your ROM (unless it's a clean ROM) because if the patch overwrites an offset that's already been used it can cause some nasty issues. Also, it doesn't seem that there's any information reguarding how to actually add a new type here. Perhaps Dragoon might be willing to make a tutorial or add to this thread to describe the process.

ShyRayq
January 25th, 2014, 10:33 PM
9 times out of 10 if you ask for a patch in the Research and Development forum you're not going to get one, just so you know. This is usually because this stuff requires a knowledge of ASM and cannot be inserted easily without messing up your ROM (unless it's a clean ROM) because if the patch overwrites an offset that's already been used it can cause some nasty issues. Also, it doesn't seem that there's any information reguarding how to actually add a new type here. Perhaps Dragoon might be willing to make a tutorial or add to this thread to describe the process.

Just saying...since Dragoon=ShyRayq=me, there is a tutorial for this...by me.
So, one can just follow that. Or just use MrDollSteak's rom base for easy, no hassle adding of the Fairy type.