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

Quick Research & Development Thread

Criminon

Forever Spriting
265
Posts
11
Years
[FR] Battle hud offsets with pallets

I'm not sure this deserves its own thread, but I know the information will be useful to someone.

There are two images used for the battle hud. The enemy hud, and your pokemon's hud.

The enemy hud location is:
D1F604

Your pokemon's is:
D1F340

Each of these use the same pallet at:
D11b84

Entering these into the program NSE and setting the width to "8" and the height to "16" will display a perfect image of them, only cut in half. Happy editing!
 
9
Posts
10
Years
  • Age 27
  • Seen Jul 27, 2016
While inserting my new map into my hack I had the problem that the calculated map points were wrong.
Like for example ROUTE 1 has the block size 1x2 so at some point at the overworld the map shows your player at the upper point or the lower point.
When you change your map size things are messed up, because the calculation goes wrong. If you want to change this go to 0x083F2178. It takes some trying to find the right offset for your location. It starts with the citys which are 1x1.
 
275
Posts
8
Years
Two doubts/ideas/requests:
1 - Is there a way to make fainted wild Pokémon not disappear, so you could catch them easier after they faint? And making they get some health back after an attempt to capture (so it looks like the anime, a little more)?
2 - Also I know this have probably been discussed before, but how hard would it be to make a Pokémon have more than 4 attacks?
I know you wouldn't have to change anything within the Pokédex. Adding one or two summary page with another 4 attacks each (if we could make it to 8 attacks, or 12 respectively) would solve the OW problems.
Inside battles, I don't have knowledge to make a correct statement. But the way I see, you only would have to change the "'Pokémon X' is trying to learn 'move Y', but he already know four moves. Forget a move to make room for 'move Y'?" routine, the room for the moves themselves and a way to show four moves in three different sets.
Is all that too difficult? What would it take?
 

C me

Creator of Pokemon League Of Legends
681
Posts
10
Years
  • Age 27
  • Seen Apr 9, 2021
Two doubts/ideas/requests:
1 - Is there a way to make fainted wild Pokémon not disappear, so you could catch them easier after they faint? And making they get some health back after an attempt to capture (so it looks like the anime, a little more)?
2 - Also I know this have probably been discussed before, but how hard would it be to make a Pokémon have more than 4 attacks?
I know you wouldn't have to change anything within the Pokédex. Adding one or two summary page with another 4 attacks each (if we could make it to 8 attacks, or 12 respectively) would solve the OW problems.
Inside battles, I don't have knowledge to make a correct statement. But the way I see, you only would have to change the "'Pokémon X' is trying to learn 'move Y', but he already know four moves. Forget a move to make room for 'move Y'?" routine, the room for the moves themselves and a way to show four moves in three different sets.
Is all that too difficult? What would it take?

I don't think there's enough RAM for that many moves, if there is space in the RAM it could be possible.
 

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
2,475
Posts
11
Years
Two doubts/ideas/requests:
1 - Is there a way to make fainted wild Pokémon not disappear, so you could catch them easier after they faint? And making they get some health back after an attempt to capture (so it looks like the anime, a little more)?
2 - Also I know this have probably been discussed before, but how hard would it be to make a Pokémon have more than 4 attacks?
I know you wouldn't have to change anything within the Pokédex. Adding one or two summary page with another 4 attacks each (if we could make it to 8 attacks, or 12 respectively) would solve the OW problems.
Inside battles, I don't have knowledge to make a correct statement. But the way I see, you only would have to change the "'Pokémon X' is trying to learn 'move Y', but he already know four moves. Forget a move to make room for 'move Y'?" routine, the room for the moves themselves and a way to show four moves in three different sets.
Is all that too difficult? What would it take?

Each of those things requires tampering with the engine.

If you're adding or taking away any moves, even one, you have to break half the game and edit every single instance of move reading and writing, names and even things like position and structures.
So if you like to break the game in half and rewrite almost the entire engine for moves, start as soon as possible since you'll be at it for 8 years.
 
275
Posts
8
Years
I don't think there's enough RAM for that many moves, if there is space in the RAM it could be possible.

Each of those things requires tampering with the engine.

If you're adding or taking away any moves, even one, you have to break half the game and edit every single instance of move reading and writing, names and even things like position and structures.
So if you like to break the game in half and rewrite almost the entire engine for moves, start as soon as possible since you'll be at it for 8 years.

:( :( :( :( :( :( :( :(
It's hard... Tedious, long and super hard...

Even the first one? I saw the experience gain after catching a wild Pokémon, and I thought there could be a way to make the game "wait" for you to decide to capture it or not after the Pokémon faints.
 

C me

Creator of Pokemon League Of Legends
681
Posts
10
Years
  • Age 27
  • Seen Apr 9, 2021
:( :( :( :( :( :( :( :(
It's hard... Tedious, long and super hard...

Even the first one? I saw the experience gain after catching a wild Pokémon, and I thought there could be a way to make the game "wait" for you to decide to capture it or not after the Pokémon faints.

I'm not really that familiar with it, but BSP has a faintpokemon command, which I think makes the Pokemon faint. You can start there.
 

Deokishisu

Mr. Magius
990
Posts
18
Years
Thanks bro, I'll look into it. =D

You'll most likely have to modify the catch rate formula for every Poke Ball as well, because I don't think they're set up to handle a Pokemon with 0.0% health left. From what I understand, you want the Pokemon to faint, but you want the battle's end to be delayed by a turn to give the player the chance to catch it?

Honestly, this feature seems like it's way above your current skill level. You should work your way up to that level with more "conventional" hacking before attempting this, I would think.

Furthermore, allowing every Pokemon to have more than four moves would require expanding the data structure that handles a Pokemon's information, not to mention you'd have to C up interfaces to display those extra moves, and find some way to handle switching sets in battle for both the player and the AI. If an AI Trainer is to have custom movesets, you'd have to set up a way to save eight moves per Pokemon in that structure too. The game is set up with the four move limit, and every structure/feature that involves using, displaying, or otherwise refers to Pokemon moves assumes that the limit is four. That's an almost insurmountable amount of research and targeted ASM edits to accomplish, and it has a good chance of breaking the game in ways that are not immediately obvious because of the scope of the changes. If, once you get to the skill level that how this all works is understandable to you, and you still think it's worth the effort to change, then go for it! But for those who do know how difficult and impractical this would be to implement, it's not worth the time investment to do for someone else.
 
275
Posts
8
Years
You'll most likely have to modify the catch rate formula for every Poke Ball as well, because I don't think they're set up to handle a Pokemon with 0.0% health left. From what I understand, you want the Pokemon to faint, but you want the battle's end to be delayed by a turn to give the player the chance to catch it?

Honestly, this feature seems like it's way above your current skill level. You should work your way up to that level with more "conventional" hacking before attempting this, I would think.

Furthermore, allowing every Pokemon to have more than four moves would require expanding the data structure that handles a Pokemon's information, not to mention you'd have to C up interfaces to display those extra moves, and find some way to handle switching sets in battle for both the player and the AI. If an AI Trainer is to have custom movesets, you'd have to set up a way to save eight moves per Pokemon in that structure too. The game is set up with the four move limit, and every structure/feature that involves using, displaying, or otherwise refers to Pokemon moves assumes that the limit is four. That's an almost insurmountable amount of research and targeted ASM edits to accomplish, and it has a good chance of breaking the game in ways that are not immediately obvious because of the scope of the changes. If, once you get to the skill level that how this all works is understandable to you, and you still think it's worth the effort to change, then go for it! But for those who do know how difficult and impractical this would be to implement, it's not worth the time investment to do for someone else.

The fainting Pokémon is just an idea based in the anime. Most of the times, a Pokémon is defeated there, before a capture is attempted.
I believe it could be easier, as the experience after catching a Pokémon was simple too. I never thought about the Pokéballs, actually. Just had the idea and let it out.
Believe me, not trying that until a lot of other stuff is done, here.

As for the maximum moves a Pokémon can have, I thought that would be easy to just add a new page to the "Summary" screen, as the same easy way to add a new layer to the "Fight" command inside a battle.
I didn't know it involved so much. Plus, I thought the moves were directed for each Pokémon. I thought each Pokémon had 4 slots, and the game would just "fill the blanks" for the Pokémon every time a move was shown (fighting, Summary screen, etc, etc). I thought just changing this number to 8 and adding a viewable way of using the other slots was enough.
I also thought after GoGoJJTech's explanation that maybe the attacks could be divided into "sets". That way, before the game "chooses" or "displays" (or whatever) using codes like "load move1, move2, move3 and move4" it would come with a "load set1, set2" beforehand. That way, you could still have codes for 4 moves, but you could choose what "block of 4 moves" you could use before.
I don't know if the way I explained it, it sounded silly or just plain stupid. I don't have much programming knowledge, but it seemed like an alternative (not by far a much efficient one) to rewriting half the game.

But no sweat, dropped it.
Maybe if I ever try to write a game from scratch, who knows...
 

Criminon

Forever Spriting
265
Posts
11
Years
Just curious. Do you have any more information on the full layout of the battle HUD. As in how to change its layout and font?

The rest of the offsets are:
D1F340 - Player normal battles
D1F794 - Player double battles
D1F604 - Enemy normal battles
D1F928 - Enemy double battles
D1FABC - Safari ui
D11BC4 HP bar (Pallet D11BA4)
D11BC4 XP bar (Pallet D11B84)
E7BB04 Trainer Pokeball line (think it uses pallet D11B84)

As for the maps, I have no clue where they are, and I'm still searching. The XP and health bars are missing another image, and once it gets to a certain point will change to that image, if you find it, post it here please. Also no clue on where the text is.
 

Splash

But nothing happened.
658
Posts
14
Years
Anyone know where I can edit the table(?) for the friendship/happiness?
To elaborate on this something like making the decrease of a pokemon's friendship 10 instead of 1..
 

Criminon

Forever Spriting
265
Posts
11
Years
This stuff should help anyone wanting to check their party's hp.
0x20242DA is the address stored in RAM for the 1st pokemon in your party's HP.
0x20242DC is the max HP.
0x20242D4 is the status ailment a pokemon is currently suffering. (00 being nothing)

Using comparefarbytetobyte 0x20242DA 0xnumber you want to check
you can easily check a pokemon's hp.

using comparefarbytetobyte 0x20242DC 0xnumber you want to check
you can easily see if a pokemon has enough hp for something.

using writebytetooffset 0xstatus 0x20242D4
you can easily edit the status effecting them.

For the rest of your party, take these offsets and add 0x64 to them.
 
534
Posts
11
Years
  • Age 26
  • Seen Jul 24, 2023
After a long battle with cancer trying to find the RAM location of the player's money, I had a feeling that it is encrypted somewhere in the RAM and that's why I can't find it. So after going to my local POKeMART, I found a little routine that seems to decrypt something. After doing further testing, I made this routine to get the player's current money using the game's own code.

The routine:
Spoiler:

I slept after that...

Umm... Hey guys, I need a little bit of help. I saw that code up there just now that Haru~ posted years ago, so I was trying to use it, and yeah it does what it does but it only works as long as your money is below 65535 (the var limit). What do I do?

And if it helps, here's my script.
Spoiler:

Thanks in advance!
 
218
Posts
10
Years
  • Seen Nov 12, 2021
Choice Scarf for Emerald :
Spoiler:


Same idea than choice spec, give the special 0x1D to allow only one move, and give the same held effect than in the routine (which can be whatever you want). Choice scarf/spec MUST have a different held effect of course. There's two routines because there's apparently two checks (don't ask me why)
 
Last edited:

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
In Emerald :

Wrap and such does 1/8 damage instead of 1/16 : write C0 08 instead of 00 09 at 08040D90

To add onto this, to make it so that (like Gen 5 and onwards) the Wrap moves last for 4 or 5 turns (instead of 2 to 5) change the byte at the following locations to:

Fire Red:
020A4A: 01
020A4E: 05
Emerald:
0492EE: 01
0492F2: 05
 
Last edited:
275
Posts
8
Years
Ditto's unique ability to breed with everything despite being genderless is a property of its egg group, but it won't actually produce the right eggs if you give something outside of slot x84 the Ditto egg group- you'll just get a bunch of Bulbasaur if there's no female involved. To fix this, change the byte at x4602A from x84 to the slot you want to behave like Ditto.

While I'm pointing out breeding quirks that are of no use to anyone:

An egg that would hatch as the byte at x46068 (normally x1D, female nidoran) has a 50% chance to instead hatch as the byte at x4607E (normally x20, male nidoran).

Furthermore, an egg that would normally hatch as the word at x460d0 (normally x183, Illumise) has a 50% chance of hatching as twice the byte at x46096 (normally xC1, half of Volbeat's index number).

Volbeat and male Nidoran family members do not produce their female counterparts when breeding with Ditto in Gen 3.

There's a second Ditto check at x460A2- this one doesn't affect the child's species but it probably is important for inheritance.

If an egg would hatch to be double the byte at x45fa8 (xB4, half of Wynaut's index number) and a parent is not holding the item at x45fd8 and x45fdc (xDD, Lax Incense), the baby will become the byte at x45fe0 (xCA, Wobbuffet).

If an egg would hatch to be double the byte at x45fb0 (xAF, half of Azurill's index number) and a parent is not holding the item at x45fee and x45ff2 (xDC, Sea Incense), the baby will become the byte at x45ff6 (xB7, Marill).

Azurill's index number is constructed a second time at x45fe6- I'm not exactly sure *why* it's needed but if the baby's index number doesn't match it the game won't consider changing it to a Marill.

Using this information, how can I make Ditto breed with himself too?
Also, how can I make Pokémon breed only with his evolutionary family and Ditto?
Will I have to make a new Egg Group for each evolutionary family? If yes, how do I do it?
What about the Nidoran's and Volbeat/Illumise's case? I just put them in the same evolutionary family and they will breed?
How can I make they not breed with Ditto, only amog themselves (Nidorans and Volbeat/Illumise)?
How can I make the first Pokémon of every evolutionary family to be surely what comes out of an egg (No Marill, Wobbuffet, Pikachu, etc.), never skipping a baby?
Lastly, how can I test this without having to go all the way 'till Island 4?
 

Criminon

Forever Spriting
265
Posts
11
Years
I've been researching Tile Background behavior bytes.

This thread here exists:
http://www.pokecommunity.com/showthread.php?t=144408
But its not complete. Here are a few other helpful ones. I'll update as I find more.


0x9 works like 0x1 (Wild Battle) except for the top layer covers the player.
0x21 works like 0x1 or 0x9 (Wild Battle) except for the player is above both of them.
0x60 works in an odd way. It deletes whatever image you had on there, and replaces it with random ones that you are able to walk over.

If anyone knows which block allows both the up and down layers to cover the player, please let me know!
 
Last edited:
Back
Top