• 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?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best places on the 'net to talk Pokémon and more! Community members will not see the bottom screen advertisements.
  • Want to share your adventures playing Pokémon?
    Check out our new Travel Journals forum for sharing playthroughs of ROM Hacks, Fan Games, and other Pokémon content!
  • IMPORTANT: Following a takedown request, the following hacks have been delisted from PokéCommunity:

    • Pokémon Glazed
    • Pokémon: Giratina Strikes Back
    • Pokémon Flora Sky
    • Pokémon Stranded
    The downloads and discussion threads for these hacks will no longer be accessible, and staff will be unable to return questions regarding accessing this content.

Quick Research & Development Thread

91
Posts
14
Years
  • Seen Feb 22, 2023
I acutally thought about this when I was asking the new cut like moves thingy. My current idea is to hijack the overworld routine(which basically takes the Overworld ID as input and then loads the sprite) so that the bike overworld is replaced by a dynamic ID. This way you don't have to concern about graphics anymore. I actually already wrote such a routine, but replaced the normal hero OW, it would not be a problem to extend this for the bike OW though. I also thought about making an item to do this job, one could basically hack the bike routine to do this and just check for any ridable pokémon in the current party. If there is no such pokémon it would basically not work and display a message. It would be way cooler though to have the ability on the pokémon itself(Like on the menu or as a dedicated move)

Everything else can be done very easily(You can see the outcome of this in the pokémon sovereign of the skies thread or on the youtube video: https://www.youtube.com/watch?v=IcYepxEgAHA

I may also give you the code sample for this if you want just ask me via PM it's for the german emerald version though (BPED) and you need to figure out the needed branches and routines yourself for your version(also the dedicated offsets)

What would be still really nice would be a way to implement this in a user friendly way. An item would be fine but how would it look like? Like a whip? Guess that would be rather harsh. Also the user can't decide which pokémon to ride this way. Not the best option I suppose...

~SBird
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
I acutally thought about this when I was asking the new cut like moves thingy. My current idea is to hijack the overworld routine(which basically takes the Overworld ID as input and then loads the sprite) so that the bike overworld is replaced by a dynamic ID. This way you don't have to concern about graphics anymore. I actually already wrote such a routine, but replaced the normal hero OW, it would not be a problem to extend this for the bike OW though. I also thought about making an item to do this job, one could basically hack the bike routine to do this and just check for any ridable pokémon in the current party. If there is no such pokémon it would basically not work and display a message. It would be way cooler though to have the ability on the pokémon itself(Like on the menu or as a dedicated move)

Everything else can be done very easily(You can see the outcome of this in the pokémon sovereign of the skies thread or on the youtube video: https://www.youtube.com/watch?v=IcYepxEgAHA

I may also give you the code sample for this if you want just ask me via PM it's for the german emerald version though (BPED) and you need to figure out the needed branches and routines yourself for your version(also the dedicated offsets)

What would be still really nice would be a way to implement this in a user friendly way. An item would be fine but how would it look like? Like a whip? Guess that would be rather harsh. Also the user can't decide which pokémon to ride this way. Not the best option I suppose...

~SBird

I think a saddle would work. However, your method is much more difficult than mine. The structure of OWs involves 4 different tables, and each sprite, just for headers and pointers, nevermind the images themselves, would need at least 30 bytes, per image. For my idea, we would just read directly from an image table with 12 bytes max (pokemon number (2bytes), img pointer (4 bytes), palette pointer (4 bytes)). And we wouldn't have to deal with all of the extra data that OWs have.

Also, I'm sad to say, that on Emerald, there is no hack to allow more than 256 OWs. Right now, emerald is already at 240. This would limit you to an extreme amount unless you port over JPAN's massive OW hack.

On another note, we could also just hack the OW loader, so that when it is loading the bike, we simply push it to a different table, but using all of the same parameters as the bike. Then we wouldn't need to worry about expanding OWs.

If Jambo is interested, he could code it into a move himself, since he knows how to, but I don't know if this would be his thing.

If you do want to continue with the bike OW thing, go to RHO. I just finished code to force an immediate OW switch that doesn't require a reload of the screen or warping.
 
91
Posts
14
Years
  • Seen Feb 22, 2023
I think a saddle would work. However, your method is much more difficult than mine. The structure of OWs involves 4 different tables, and each sprite, just for headers and pointers, nevermind the images themselves, would need at least 30 bytes, per image. For my idea, we would just read directly from an image table with 12 bytes max (pokemon number (2bytes), img pointer (4 bytes), palette pointer (4 bytes)). And we wouldn't have to deal with all of the extra data that OWs have.

Also, I'm sad to say, that on Emerald, there is no hack to allow more than 256 OWs. Right now, emerald is already at 240. This would limit you to an extreme amount unless you port over JPAN's massive OW hack.

On another note, we could also just hack the OW loader, so that when it is loading the bike, we simply push it to a different table, but using all of the same parameters as the bike. Then we wouldn't need to worry about expanding OWs.

If Jambo is interested, he could code it into a move himself, since he knows how to, but I don't know if this would be his thing.

If you do want to continue with the bike OW thing, go to RHO. I just finished code to force an immediate OW switch that doesn't require a reload of the screen or warping.

I don't think it would be a problem to expand the OW table or at least use some sort of switch to use an alternate table if needed. I did not try it though. I already have my code to change the OW. Actually as said i'm only hijacking the loader routine and switching out the parameter(which is passed by r0 or r1, not quite sure at the moment) to make the game load a different OW. It does not actually effect how the sprite is handled by the game, so if you load a sprite without running animation you won't have one, the game will just accept it as being the new hero OW. If you do load a sprite with a few extra frames it will be no problem eighter, they are just not used. Also if you replace the bike and use the bike routine one will be able to "ride" a pokémon. If it is needed you would also have to expand the OW table. In fact this is (i guess) regulated by a simple cmp opcode to check if the passed argument is greater than the fixed value, if it is, it handles it differently and I guess OWs over 255(1byte) will be killed by the standardized lsl lsr structures that classifies the argument as a byte value, leaving only the last 8 bit of the parsed value. If someone wants to increase the amount of OWs in the table he would have to a) repoint the table to somewhere in the rom, b) increase the parsed value to at least half-word size and c) bypass the compare that is used by the game to check wether the OW is one of the "special treated" ones. Maybe you could arrange it so that those won't get lost and you just load your real OWs above the byte border again. I don't know exactly what those few OWs are for, but I guess if you are able to keep them you always should because it's part of the main game.

I did once write a routine to at least use more than one OW table therefore I know that it's working, but I did not test to expand the current table at all. I just don't see any obstacles(I did not look at JPANs routines eighter, since they are all for Firered and I guess at least in the part of how the game handles overworlds those two have some differences, at least in FR OWs are also captable of executing scripts if the right sort of behavior byte is set, this is not the case in Emerald)

Well I guess i will try to use some sort of item first, for the moment I just can't come up with another solution probably it is also possible to implement some sort of "professional tamer" who allows you to "set" your saddle to a specific pokémon which of course can be "ridden" so you have an actual explanation for the player. Still using a ride move would be the best solution(in my opinion) but who knows what the future brings...

~SBird

Edit: I guess if one expands the OW table he is also not able to use the new OW regularly on a map, at least advance map does not allow half word sized values. I don't know if this is also stored in byte form but it should'nt bother the game if it loads it from a dynamic ram adress like a in-game variable or something, you can basically store the "new bike" OWs and everything you do not need to use like regurarly on a map beyond the byte limit and your regular ows befor that. I don't know how JPAN worked himself arround this problem, I'm pretty sure advance map and other mapping tools won't support entrys beyond one byte if the map structure does not allow it. JPAN would have to hack the whole map structure which would make all the normal maps unuseable and the tools had to adapt themselves which is also unknown to me(Maybe i'm just uninformed) ;)
 
Last edited:

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
I don't think it would be a problem to expand the OW table or at least use some sort of switch to use an alternate table if needed. I did not try it though. I already have my code to change the OW. Actually as said i'm only hijacking the loader routine and switching out the parameter(which is passed by r0 or r1, not quite sure at the moment) to make the game load a different OW. It does not actually effect how the sprite is handled by the game, so if you load a sprite without running animation you won't have one, the game will just accept it as being the new hero OW. If you do load a sprite with a few extra frames it will be no problem eighter, they are just not used. Also if you replace the bike and use the bike routine one will be able to "ride" a pokémon. If it is needed you would also have to expand the OW table. In fact this is (i guess) regulated by a simple cmp opcode to check if the passed argument is greater than the fixed value, if it is, it handles it differently and I guess OWs over 255(1byte) will be killed by the standardized lsl lsr structures that classifies the argument as a byte value, leaving only the last 8 bit of the parsed value. If someone wants to increase the amount of OWs in the table he would have to a) repoint the table to somewhere in the rom, b) increase the parsed value to at least half-word size and c) bypass the compare that is used by the game to check wether the OW is one of the "special treated" ones. Maybe you could arrange it so that those won't get lost and you just load your real OWs above the byte border again. I don't know exactly what those few OWs are for, but I guess if you are able to keep them you always should because it's part of the main game.

I did once write a routine to at least use more than one OW table therefore I know that it's working, but I did not test to expand the current table at all. I just don't see any obstacles(I did not look at JPANs routines eighter, since they are all for Firered and I guess at least in the part of how the game handles overworlds those two have some differences, at least in FR OWs are also captable of executing scripts if the right sort of behavior byte is set, this is not the case in Emerald)

Well I guess i will try to use some sort of item first, for the moment I just can't come up with another solution probably it is also possible to implement some sort of "professional tamer" who allows you to "set" your saddle to a specific pokémon which of course can be "ridden" so you have an actual explanation for the player. Still using a ride move would be the best solution(in my opinion) but who knows what the future brings...

~SBird

Edit: I guess if one expands the OW table he is also not able to use the new OW regularly on a map, at least advance map does not allow half word sized values. I don't know if this is also stored in byte form but it should'nt bother the game if it loads it from a dynamic ram adress like a in-game variable or something, you can basically store the "new bike" OWs and everything you do not need to use like regurarly on a map beyond the byte limit and your regular ows befor that. I don't know how JPAN worked himself arround this problem, I'm pretty sure advance map and other mapping tools won't support entrys beyond one byte if the map structure does not allow it. JPAN would have to hack the whole map structure which would make all the normal maps unuseable and the tools had to adapt themselves which is also unknown to me(Maybe i'm just uninformed) ;)

JPAN's hack, in its entirety, enables up to 65000 and most of the routines taken exist in all Advance Gen games, especially the main loader, which is exactly the same. However, I have a better idea.

What I am seeing, if we continue with the bike, is a hack near the end of the routine which branches if the hero's bike is being loaded. At that point, we send it to check a var which will then read from a table and load the correct sprite. This, combined with my OW hack (simply for instaloading of palettes) would work well and wouldn't require an expansion of OWs.
 
91
Posts
14
Years
  • Seen Feb 22, 2023
JPAN's hack, in its entirety, enables up to 65000 and most of the routines taken exist in all Advance Gen games, especially the main loader, which is exactly the same. However, I have a better idea.

What I am seeing, if we continue with the bike, is a hack near the end of the routine which branches if the hero's bike is being loaded. At that point, we send it to check a var which will then read from a table and load the correct sprite. This, combined with my OW hack (simply for instaloading of palettes) would work well and wouldn't require an expansion of OWs.

That could probably work as well, guess I'm going to consider implementing some of that after I finished implementing all the gen4/5 stuff...
There is still no solution for the "how", I'm still not converned by the idea of implementing an item for the sole purpose of riding a pokémon which you can't even choose.

~SBird
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
That could probably work as well, guess I'm going to consider implementing some of that after I finished implementing all the gen4/5 stuff...
There is still no solution for the "how", I'm still not converned by the idea of implementing an item for the sole purpose of riding a pokémon which you can't even choose.

~SBird

How is REALLY easy. We just make an item that checks species vs a table. If the species number appears on the table, said pokemon can be ridden. Now, it is only what that item is.
 

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
2,475
Posts
11
Years
The behavior bytes in Advance Map are stored in a really weird format. The later ones such as 80s-90s usually display messages. Each script is 9 bytes long, and is stored in a table. So I decided to find the start of said table by going 9 bytes left until I hit 0. The problem is, The area where I ended contains scripts like adding an item from "MSG_OBTAIN". So this is a stumble...
 

trafalgar

FireBlast
15
Posts
13
Years
  • Seen Apr 14, 2015
Is there any way to swap the values ​​of two registers?
r1 -> r2
r1 <- r2

Excuse my English but I use google translator: \
 

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
2,475
Posts
11
Years

karatekid552

What happens if I push it?....
1,771
Posts
11
Years

xGal

Mhm
241
Posts
12
Years
In Jambo's DirectSound voices per moment extention he said that the maximum for FR/LG/E is 12 DirectSound voices per moment and 7 in R/S. If you will choose a higher number, the game will probably freeze, crash, slow down etc.

So is it possible to extend the limit using an ASM code?
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
In Jambo's DirectSound voices per moment extention he said that the maximum for FR/LG/E is 12 DirectSound voices per moment and 7 in R/S. If you will choose a higher number, the game will probably freeze, crash, slow down etc.

So is it possible to extend the limit using an ASM code?

It's tied to the way that the IWRAM is used, so not without a huge overhaul of the engine, and even if you did, you could only gain 4 extra channels (not tracks).

In all the GBA games, the max number of tracks is 10. The max number of channels is what you're changing.
 

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
2,475
Posts
11
Years
106
Posts
15
Years
  • Seen May 29, 2019
I just finished code to force an immediate OW switch that doesn't require a reload of the screen or warping.

Could your code in theory be adapted for an item. I could think of a load of uses for various costumes within the game, especially if the game is able to check the players OW id number. And if the bag had its own "costume" pocket it could had a whole new level of customisation.

Oh and I think a saddle would be the most appropriate item in order to ride pokemon.
 

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
OK, let me rephrase. The max without hacking is 10. Snarky comments like this are why I quit ROM Hacking. Happy now?
Gosh, look what you did gogojjtech. Making Jambo51 quit like dat... :P

Back on topic, I found the battle script associated with both Birch's whining as well as the "Can't Escape!" message in Ruby. The offset of the script is 0x1d8e44 for those interested.
 

Full Metal

C(++) Developer.
810
Posts
16
Years
Gosh, look what you did gogojjtech. Making Jambo51 quit like dat... :P

Back on topic, I found the battle script associated with both Birch's whining as well as the "Can't Escape!" message in Ruby. The offset of the script is 0x1d8e44 for those interested.

Does it also include eht battling part
 
Back
Top