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

Red hack: Shin Pokemon Red/Blue/Green/JP builds (Bugfix, AI, and QoL patch)

536
Posts
4
Years
    • Seen May 4, 2024
    Normally, I can continue progress. But this rom specifically erased my save when I updated a few months ago. Same rom name and all. I had a backup fortunately.

    I appreciate all the help you've given me regardless.


    I think this is an issue with your K101 doing some kind of hash check. I'll see if I can bypass it.

    I'm using a few different tools:
    • There's goombasav (I use GoombasavCore.WinForms.x64.exe).
    • Also the Revo save converter.
    • Goomba color.
    • And finally the good ol' VBA emulator.

    1. As before, I use goombasav to extract a raw gbc sav from your k101 sav.
    2. I use goomba color to compile the updated gbc rom into a gba rom.
    3. I open VBA, check my save type settings (automatic & 64k flash), and load the goombafied rom. I start a new game and then save the game after it drops me into the player's room. This generates a dummy VBA sav.
    4. I use goombasav again to load the VBA dummy sav. This time I use the raw gbc sav from before to replace the saved data in the dummy sav.
    5. I take the modified dummy sav and use it to fire up VBA with the goombafied rom. The saved game is detected and loads with invisible walls. Softlock teleport clears the invisible walls. Game is saved again. So far so good.
    6. I go into the gooba options (L + R) and go into and out of the save manager. This is just so that goomba updates its own save structure. This results in a cleaned VBA sav for the goombafied rom.
    7. Finally I use the Revo save converter to convert the cleaned VBA sav into a K101 sav. See attached.

    So the file I ended up with is the same size as the file you initially posted. That's a good sign. But what a task it is to cut through not one but two special save structures. 136KB K101 save --> 32KB raw gbc save --> 64KB goomba GBA save --> 136 KB K101 save.

    EDIT: You might want to replicate this process using your own compiled rom update just to make sure everything is consistent between the rom and the sav.
     

    Attachments

    • pokered.gba.sav
      136 KB · Views: 1
    Last edited:
    694
    Posts
    7
    Years
    • Seen Feb 22, 2024
    I think this is an issue with your K101 doing some kind of hash check. I'll see if I can bypass it.

    I'm using a few different tools:
    • There's goombasav (I use GoombasavCore.WinForms.x64.exe).
    • Also the Revo save converter.
    • Goomba color.
    • And finally the good ol' VBA emulator.

    1. As before, I use goombasav to extract a raw gbc sav from your k101 sav.
    2. I use goomba color to compile the updated gbc rom into a gba rom.
    3. I open VBA, check my save type settings (automatic & 64k flash), and load the goombafied rom. I start a new game and then save the game after it drops me into the player's room. This generates a dummy VBA sav.
    4. I use goombasav again to load the VBA dummy sav. This time I use the raw gbc sav from before to replace the saved data in the dummy sav.
    5. I take the modified dummy sav and use it to fire up VBA with the goombafied rom. The saved game is detected and loads with invisible walls. Softlock teleport clears the invisible walls. Game is saved again. So far so good.
    6. I go into the gooba options (L + R) and go into and out of the save manager. This is just so that goomba updates its own save structure. This results in a cleaned VBA sav for the goombafied rom.
    7. Finally I use the Revo save converter to convert the cleaned VBA sav into a K101 sav. See attached.

    So the file I ended up with is the same size as the file you initially posted. That's a good sign. But what a task it is to cut through not one but two special save structures. 136KB K101 save --> 32KB raw gbc save --> 64KB goomba GBA save --> 136 KB K101 save.

    EDIT: You might want to replicate this process using your own compiled rom update just to make sure everything is consistent between the rom and the sav.

    Thanks for the help. I actually use the revo K save manager. But, what command line did you use to get it to work with gbc saves? For gba, I do a "Converter.exe" "Pokemon Mod" 128. And that allows me to use Revo GBA saves on VBA.
     
    536
    Posts
    4
    Years
    • Seen May 4, 2024
    Thanks for the help. I actually use the revo K save manager. But, what command line did you use to get it to work with gbc saves? For gba, I do a "Converter.exe" "Pokemon Mod" 128. And that allows me to use Revo GBA saves on VBA.

    There are two separate converter exe files. The one you are talking about is called K1toVBA. To convert in the other direction you need to use the other exe called VBA2K1 (it doesn't use the 128 argument).
     
    536
    Posts
    4
    Years
    • Seen May 4, 2024
    It's the end of the month, so I figured I'd put out version 1.19.

    Changelog for the master branch:
    • Fixed a minor bug where the first byte of pokedex "owned" gets cleared on a new game+
    • Fixed minor desync with abbreviated rival music
    • Fixed poison/burn/leechseed damage sometimes being applied twice
    • Minor changes to support external randomizer
    • Updated title screen to use kanji instead of katakana
    • Fixed an artifact when title screen 'mons scroll left in GBC-mode
    • Fixed a bug in AI roster scoring when evaluating type matchups for switching
    • Tweaked item usage for cooltrainers and Giovanni
    • Increased encounter rate from 3/256 to 11/256 for the following pokemon
      • charmander, bulbasaur, squirtle, eevee
      • bellsprout (red), oddish (blue), vulpix (red), oddish (blue)
      • farfetch'd (route 12)
    • Increased mew's encounter rate from 1.5/256 to 3/256
    • Improved exp calculation for developers who want a level cap between 101 and 255
      • EXP calculation routine now does math in 4 bytes instead of 3 bytes
      • Exp calculation result is still capped to 3 bytes regardless of level cap to prevent overflow
      • The byte cap on the exp result means that certain growth rates may have a level cap
      • For example, the "slow" growth rate is theorized to cap at level 237
    • Trainer battle prize money uses 3 bytes instead of 2, lifting the 9999 cap on winnings
    • To prevent infinite loops, Rage ends after 2 to 3 turns (attack boosts are kept)
    • AI will not do actions during Rage or when recharging

    Changelog for the lite branch:
    • fixed minor desync with abbreviated rival music
    • fixed poison/burn/leechseed damage sometimes being applied twice
    • minor changes to support external randomizer
    • AI will not do actions during Rage or when recharging
    • Improved exp calculation for developers who want a level cap between 101 and 255
      • EXP calculation routine now does math in 4 bytes instead of 3 bytes
      • Exp calculation result is still capped to 3 bytes regardless of level cap to prevent overflow
      • The byte cap on the exp result means that certain growth rates may have a level cap
      • For example, the "slow" growth rate is theorized to cap at level 237
    • Trainer battle prize money uses 3 bytes instead of 2, lifting the 9999 cap on winnings
    • To prevent infinite loops, Rage ends after 2 to 3 turns (attack boosts are kept)
    • Fixed an artifact when title screen 'mons scroll left in GBC-mode
    • Fixed a bug in AI roster scoring when evaluating type matchups for switching

    The bash script for randomizing the rom, "randoshinred", has also been added to the released master branch. It seems to work okay so far. I'll see how this one goes.
     
    Last edited:
    3
    Posts
    4
    Years
    • Seen Apr 3, 2024
    nice update, i was just about to ask if bulbasaur and bellsprout really exist lol
    i spent almost 4 hours and not even got a glimpse of them.
    Edit : just caught a bulbasaur, like 5 mins only after the update !
     
    Last edited:
    536
    Posts
    4
    Years
    • Seen May 4, 2024
    Attention all. If you are on version 1.18 or 1.19 of either the lite or master branch, please update your game to version 1.19.1 hotfix 1. It's been found that trainer AI completely ignores move preferences due to a major oversight in how I implemented PP tracking. This causes the AI to choose moves like a wild pokemon.

    Version 1.19.1 re-works the implementation so that trainer AI will check its move preferences against moves that are unusable due to Disable or having 0 PP. If the most preferable move cannot be used, then the next most-preferable move will be used instead. This follows in sequence until no moves are available and Struggle is initiated.

    I offer my humble apologies.
     

    darthbr

    Banned
    237
    Posts
    8
    Years
    • Seen Dec 8, 2023
    for legendaries respawm. i took out this 2 parts in script route 25, follow the image, i just left the above red part, is that ok??? (game wont bug)?

    my doubt it, the game compiled... like i left in image

    doubt.png
     
    536
    Posts
    4
    Years
    • Seen May 4, 2024
    for legendaries respawm. i took out this 2 parts in script route 25, follow the image, i just left the above red part, is that ok??? (game wont bug)?

    my doubt it, the game compiled... like i left in image

    doubt.png

    You missed one detail. Go to the "Route25TextRed:" function and near the bottom remove these lines.
    Code:
    ld a, $3
    ld [wRoute25CurScript], a
    ld [wCurMapScript], a
    This tells the map script routine to load script pointer #3 (that being Route25Script3) on the next frame refresh. Since you removed Route25Script3, you must remove these lines as well or else the game will jump into garbage data and crash.
     

    darthbr

    Banned
    237
    Posts
    8
    Years
    • Seen Dec 8, 2023
    You missed one detail. Go to the "Route25TextRed:" function and near the bottom remove these lines.
    Code:
    ld a, $3
    ld [wRoute25CurScript], a
    ld [wCurMapScript], a
    This tells the map script routine to load script pointer #3 (that being Route25Script3) on the next frame refresh. Since you removed Route25Script3, you must remove these lines as well or else the game will jump into garbage data and crash.

    oh thank you for help, so deleting this last part, i dont have to worry?
     
    694
    Posts
    7
    Years
    • Seen Feb 22, 2024
    Hey, so I'm likely to start a fresh playthrough of this mod on the most recent version once I finish playing Unbound. Can you confirm that leveling up past 100 works in battle? Rare candies seem to work according to the set level cap but battle EXP is a different story.
     
    536
    Posts
    4
    Years
    • Seen May 4, 2024
    Hey, so I'm likely to start a fresh playthrough of this mod on the most recent version once I finish playing Unbound. Can you confirm that leveling up past 100 works in battle? Rare candies seem to work according to the set level cap but battle EXP is a different story.

    See the v1.19 changelog. The exp calculation function has been modified to handle the math better. It also won't let you overflow the exp.

    It's been working okay so far, but I really need to sit down sometime and grind from 100 to 255 on a few different growth rate 'mons.
     
    694
    Posts
    7
    Years
    • Seen Feb 22, 2024
    See the v1.19 changelog. The exp calculation function has been modified to handle the math better. It also won't let you overflow the exp.

    It's been working okay so far, but I really need to sit down sometime and grind from 100 to 255 on a few different growth rate 'mons.

    Well, I modified the usual team I use to have a Medium Slow growth rate. I'm sure that can reach at least 250 (The set cap) before the overflow.

    Thanks for helping me with this man. I appreciate all the work you do. Hopefully this does in fact solve the issues I was having with leveling past 100.

    I'll report to you what happens. I never use rare candies so it'll be at least a month before I hit a team of 6 at level 100+.

    More people should incorporate the rematch system like you implemented. It really gives the game fresh post game life. Also, the randomized scaling trainer is amazing.
     
    536
    Posts
    4
    Years
    • Seen May 4, 2024
    Well, I modified the usual team I use to have a Medium Slow growth rate. I'm sure that can reach at least 250 (The set cap) before the overflow.

    Thanks for helping me with this man. I appreciate all the work you do. Hopefully this does in fact solve the issues I was having with leveling past 100.

    I'll report to you what happens. I never use rare candies so it'll be at least a month before I hit a team of 6 at level 100+.

    More people should incorporate the rematch system like you implemented. It really gives the game fresh post game life. Also, the randomized scaling trainer is amazing.

    Sounds good. This kind of stuff interests me, so I'm glad I can help.

    The maximum amount of exp that is supported by 3 bytes is 16,777,215.
    According to my calculations, here are the level caps for each growth rate.
    • medium-slow - 245
    • slow - 237
    • medium-fast - 255
    • fast - 255

    So even though you set the max_level constant to 250, that will be ignored for your medium-slow teammates. The function in battle that handles exp calculation for level-up passes max_level into register 'd' then calls CalcExperience to determine if the level cap experience has been reached. But CalcExperience will decrement the value in 'd' and try again if the result exceeds 3 bytes. The result is that the max_level value gets lowered on the fly.

    Come to think of it, I should probably make adjustments to rare candies and the daycare man. Rare candies can be wasted and I don't know what will happen with the daycare man.
    EDIT: Oh this is interesting. Apparently Game Freak hard-coded the day care to not increase 'mon exp past 5,242,880. Looks like I can just increase that cap and everything will still work.

    Glad you like the randomized trainer. It was actually kind of easy to do one I figured out how to hijack the process that loads trainer data.
     
    Last edited:
    694
    Posts
    7
    Years
    • Seen Feb 22, 2024
    I got a really lucky roll for my Magikarp's DV's: 15 HP, 13 ATK, 14 DEF, 14 SPD 15 SPC

    Anyways, I can't remember, but does EV growth ever stop at Level 100? I thought I heard somewhere it does.

    Also, regarding the randomized scaled trainer: How will the game handle an opponent PKMN if it's a slow growth rate and my PKMN is level 240 or higher? Would be interesting to see how the game would react.
     
    Last edited:

    darthbr

    Banned
    237
    Posts
    8
    Years
    • Seen Dec 8, 2023
    Can you explain this in item usage part: (im changing some, i created one for Erika, instead of super potion)

    cp $20
    jr nc, .sabrinareturn
    ld a, $A
    call AICheckIfHPBelowFraction
    jp c, AIUseHyperPotion
    .sabrinareturn
    ret

    (she will use hyper potion when pkmn reach 20% of life? ) -- i want make Erika use Hyper Potion when reach red life, so, wich one is correct, Sabrina os erika?

    cp $80
    jr nc, .erikareturn
    ld a, $A
    call AICheckIfHPBelowFraction
    jp c, AIUseHyperPotion
    .erikareturn
    ret

    ________________

    ; unused? joenote - repurposing for a new vendor on celadon dept store floor 3
    CeladonMart3ClerkText::

    (is this guy in game, or no?) if not, how do i activate him? is it too hard?
     
    Last edited:
    536
    Posts
    4
    Years
    • Seen May 4, 2024
    I got a really lucky roll for my Magikarp's DV's: 15 HP, 13 ATK, 14 DEF, 14 SPD 15 SPC

    Anyways, I can't remember, but does EV growth ever stop at Level 100? I thought I heard somewhere it does.

    Also, regarding the randomized scaled trainer: How will the game handle an opponent PKMN if it's a slow growth rate and my PKMN is level 240 or higher? Would be interesting to see how the game would react.

    EVs do not exist until gen 3. Instead you have stat experience. There is no cap on the total or with level. For each stat, it starts at $0000 and can go all the way to $ffff. Grinding still nets you stat exp regardless of level. Back when I was a kid, my friends and I would do the box trick to recalculate our higher stats after hitting lvl 100.

    The experience cap does not apply to AI teams because they do not have experience nor do they level-up. Their level is set to whatever and it's used for calculating stats and other things. I'm pretty sure I capped the random trainer to 255 some months. I'll have to double check that later.

    Can you explain this in item usage part: (im changing some, i created one for Erika, instead of super potion)

    cp $20
    jr nc, .sabrinareturn
    ld a, $A
    call AICheckIfHPBelowFraction
    jp c, AIUseHyperPotion
    .sabrinareturn
    ret

    (she will use hyper potion when pkmn reach 20% of life? ) -- i want make Erika use Hyper Potion when reach red life, so, wich one is correct, Sabrina os erika?

    cp $80
    jr nc, .erikareturn
    ld a, $A
    call AICheckIfHPBelowFraction
    jp c, AIUseHyperPotion
    .erikareturn
    ret

    ________________

    ; unused? joenote - repurposing for a new vendor on celadon dept store floor 3
    CeladonMart3ClerkText::

    (is this guy in game, or no?) if not, how do i activate him? is it too hard?

    Here's how to read the item usage code. Note that '$' signifies a hex number. I prefer to work in hex since it makes bits line up nicely in debugging tools.

    If the value in register 'a' is less than $20 (basically a $20 out of $ff random chance), then check to see if hp is less than 1/$A of max (basically check if hp is down to 1/10th). If hp is in fact that low, use a hyper potion.

    The extra celadon vendor is only in the master branch. You would have to re-add all the needed scripts for that map and add his sprite to the map's object header file. I'm stuck phone-posting for a while, so I can't really provide detailed instruction at this time.
     

    darthbr

    Banned
    237
    Posts
    8
    Years
    • Seen Dec 8, 2023
    EVs do not exist until gen 3. Instead you have stat experience. There is no cap on the total or with level. For each stat, it starts at $0000 and can go all the way to $ffff. Grinding still nets you stat exp regardless of level. Back when I was a kid, my friends and I would do the box trick to recalculate our higher stats after hitting lvl 100.

    The experience cap does not apply to AI teams because they do not have experience nor do they level-up. Their level is set to whatever and it's used for calculating stats and other things. I'm pretty sure I capped the random trainer to 255 some months. I'll have to double check that later.



    Here's how to read the item usage code. Note that '$' signifies a hex number. I prefer to work in hex since it makes bits line up nicely in debugging tools.

    If the value in register 'a' is less than $20 (basically a $20 out of $ff random chance), then check to see if hp is less than 1/$A of max (basically check if hp is down to 1/10th). If hp is in fact that low, use a hyper potion.

    The extra celadon vendor is only in the master branch. You would have to re-add all the needed scripts for that map and add his sprite to the map's object header file. I'm stuck phone-posting for a while, so I can't really provide detailed instruction at this time.

    No problem mate. Im using Master one. Its Just to know if its in game. Thank you!!

    __

    what is the possibility to have pokemon following you and each one have his own miniature?
    https://www.pokecommunity.com/showthread.php?t=382380

    you can check here too
    https://tcrf.net/Proto:Pokémon_Gold_and_Silver/Spaceworld_1997_Demo/Pokémon

    _ other point <
    the symbols are great, but they dont show if my pokemon is male or female ;(
     
    Last edited:
    Back
    Top