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

18
Posts
9
Years
    • Seen Jun 7, 2023
    In this image on the left red in GBC mode has colored moves. Could it be possible to use palettes for moves like that in shin?
    Shin Pokemon Red/Blue/Green/JP builds (Bugfix, AI, and QoL patch)
     
    536
    Posts
    4
    Years
    • Seen May 13, 2024
    In this image on the left red in GBC mode has colored moves. Could it be possible to use palettes for moves like that in shin?
    Shin Pokemon Red/Blue/Green/JP builds (Bugfix, AI, and QoL patch)

    Probably. I'd need to find out where in the animation code that object color is handled. The color in the left image isn't generated by the game code, but is handled by the gbc bios.
     
    536
    Posts
    4
    Years
    • Seen May 13, 2024
    In this image on the left red in GBC mode has colored moves. Could it be possible to use palettes for moves like that in shin?
    Shin Pokemon Red/Blue/Green/JP builds (Bugfix, AI, and QoL patch)

    Okay, I see what Gamefreak did here. Gen 1 pokemon does not know what a gameboy color is because it had not yet been created. The game occasionally checks to see if the SGB is being used, and if not then it assumes a regular old grayscale gameboy is being used. Shin Pokemon when played on a GBC tricks the game into thinking it is being played on a SGB and translates palette information into something the GBC can understand.

    The image on your left is running in "Not SGB" mode. The game assumes that grayscale is going to be used everywhere, so it skips over all the color-associated SGB code. The GBC bios reads from the rom header that pokemon red is being played, so it makes the object colors dark/light green and the background colors dark/light red.

    The image on your right is running in "SGB detected" mode. There's an interesting quirk that happens with attack animation objects. The palette of the object will match whatever is loaded for the background. So the color can end up a bit wrong. To get around this, Gamefreak made it so that animations switch to only using the black and white colors of the loaded palettes when operating in SGB mode.

    I'll do a little experimenting to see what I can affect.
     
    Last edited:
    536
    Posts
    4
    Years
    • Seen May 13, 2024
    Oh, this worked out splendidly!
    Shin Pokemon Red/Blue/Green/JP builds (Bugfix, AI, and QoL patch)


    This will only work when playing in GBC mode. I made it so that a palette is associated with each move type. When a move animation plays, the type is referenced and the corresponding palette is copied into the GBC's object palette registers for OBP0 to OBP3.

    I can't do much of anything with the SGB because animated objects can't really have separate colors from the background. Hardware limitation. The GBC is much more flexible giving me 8 palettes of 4 colors each for both backgrounds and objects, and directly translating and writing color information to them is more straightforward.
     
    18
    Posts
    9
    Years
    • Seen Jun 7, 2023
    Oh, this worked out splendidly!
    Shin Pokemon Red/Blue/Green/JP builds (Bugfix, AI, and QoL patch)


    This will only work when playing in GBC mode. I made it so that a palette is associated with each move type. When a move animation plays, the type is referenced and the corresponding palette is copied into the GBC's object palette registers for OBP0 to OBP3.

    I can't do much of anything with the SGB because animated objects can't really have separate colors from the background. Hardware limitation. The GBC is much more flexible giving me 8 palettes of 4 colors each for both backgrounds and objects, and directly translating and writing color information to them is more straightforward.

    It's beautiful! Colorful battles give the game a lot of life.

    I noticed that moves are sometimes the same color as the pokemon they were used on.
     
    58
    Posts
    11
    Years
    • Seen Mar 4, 2024
    Currently playing on the Vita with Gambatte.
    Is it normal for Professor Oaks sprite to get not disappear when he guides you into his lab? He just stood on the door tile. And is it Normal for Charmeleon to always crit using slash?

    I tired applying the full color ips hack and it wont boot.
    https://www.pokecommunity.com/showthread.php?t=361713
     
    Last edited:
    536
    Posts
    4
    Years
    • Seen May 13, 2024
    Currently playing on the Vita with Gambatte.
    Is it normal for Professor Oaks sprite to get not disappear when he guides you into his lab? He just stood on the door tile. And is it Normal for Charmeleon to always crit using slash?

    Yes, Oak does not actually disappear during that particular scripted movement. That object disappears inside one of the Lab scripts. Version 1.21 has a bug when playing in 60fps mode where "follow directly behind this NPC" movement makes the NPC move at double-speed.

    Yes, high-critical moves like Slash will nearly always crit when used by pokemon with good to high speed. Gen 1 gives high-critical moves a base 8x chance to crit.

    EDIT: Some more insight on how Gen 1 does critical hits (assuming code mistakes have been fixed). The battle engine randomly picks a number between 0 and 255. A critical hit is made if this number is less than the attacking mon's crit value. This crit value defaults to 0.5*[base speed] rounded down to the nearest integer. The Dire Hit/Focus Energy effect quadruples the crit value to 2*[base speed]. High-critical moves octuples the crit value to 4*[base speed].

    There is always a 1/256 chance that a critical hit does not occur (a random number of exactly 255). This means it's possible to get a critical hit 99.6% of the time given a certain base speed threshold. These thresholds are as such:
    • Normal Conditions - base speed of 510 (no pokemon has this)
    • Dire Hit / Focus Energy effect - Base speed of 128 (achieved by Electrode, Jolteon, Aerodactyl, and Mewtwo)
    • High Crit move - Base speed of 64 (anything faster than Goldeen)
    • Both of them stacked - Base speed of 16 (everything but Slowpoke)

    Try this for a bit of fun since the Focus Energy effect is fixed. Train an Eevee until it learns Focus Energy. Evolve it to Jolteon. Train it until it learns Pin Missile. Setup with Focus Energy then laugh hysterically at psychic types.
     
    Last edited:
    58
    Posts
    11
    Years
    • Seen Mar 4, 2024
    Yes, Oak does not actually disappear during that particular scripted movement. That object disappears inside one of the Lab scripts. Version 1.21 has a bug when playing in 60fps mode where "follow directly behind this NPC" movement makes the NPC move at double-speed.

    Yes, high-critical moves like Slash will nearly always crit when used by pokemon with good to high speed. Gen 1 gives high-critical moves a base 8x chance to crit.

    EDIT: Some more insight on how Gen 1 does critical hits (assuming code mistakes have been fixed). The battle engine randomly picks a number between 0 and 255. A critical hit is made if this number is less than the attacking mon's crit value. This crit value defaults to 0.5*[base speed] rounded down to the nearest integer. The Dire Hit/Focus Energy effect quadruples the crit value to 2*[base speed]. High-critical moves octuples the crit value to 4*[base speed].

    There is always a 1/256 chance that a critical hit does not occur (a random number of exactly 255). This means it's possible to get a critical hit 99.6% of the time given a certain base speed threshold. These thresholds are as such:
    • Normal Conditions - base speed of 510 (no pokemon has this)
    • Dire Hit / Focus Energy effect - Base speed of 128 (achieved by Electrode, Jolteon, Aerodactyl, and Mewtwo)
    • High Crit move - Base speed of 64 (anything faster than Goldeen)
    • Both of them stacked - Base speed of 16 (everything but Slowpoke)

    Try this for a bit of fun since the Focus Energy effect is fixed. Train an Eevee until it learns Focus Energy. Evolve it to Jolteon. Train it until it learns Pin Missile. Setup with Focus Energy then laugh hysterically at psychic types.
    Ok cool. Would it be possible to also incorporate a lot of the shortcuts into actual menus? Like a tab for the Pokémons Hidden values, a tab for shiny Pokémon in the Pokédex, etc. Also add some kind of tutorials in game for some of the new features. Trying to get my wife into Pokémon and I think this game is a perfect candidate, although I would prefer a Yellow version since that was my first game.
     
    536
    Posts
    4
    Years
    • Seen May 13, 2024
    Ok cool. Would it be possible to also incorporate a lot of the shortcuts into actual menus? Like a tab for the Pokémons Hidden values, a tab for shiny Pokémon in the Pokédex, etc. Also add some kind of tutorials in game for some of the new features. Trying to get my wife into Pokémon and I think this game is a perfect candidate, although I would prefer a Yellow version since that was my first game.

    It's easier to hijack the existing menu systems and far less intrusive than try to create all-new menu pages. Remember that the gen 1 engine forces you to scroll through them to exit. Key combos are intentional in order to cut down on the amount of menu navigation in gen 1.

    I'm going to release v1.22 (a big stonkin' update) before the end of the year. I am reorganizing the readme file for clarity. But you do bring up a good point. I will look at doing a kind of "New Player Functionality" guide for the master branch that describes all the new stuff that players can interact with.

    Real talk about yellow version. I have no plans to add yellow. There are too many engine modifications from red & blue that I would have to start all over from nothing. I'm a little burned out on gen 1 anyway, but that happens when one spends almost 4 years debugging decades-old code.
     
    58
    Posts
    11
    Years
    • Seen Mar 4, 2024
    Maybe instead of holding select or start at the Pokémon menu, we can press Select in the Pokémon preview to change though all the hidden information.
     
    536
    Posts
    4
    Years
    • Seen May 13, 2024
    Any idea what features will be in the 1.22 version

    It's a lot of adjustment and bugfixes with new features mixed-in. I'll try to cherry-pick the highlights.

    New Features (master branch)
    • The bag now supports an additional item list for an extra 20 slots of space. Press START on the bag menu to hot-swap the item list that populates the active bag. Also works in battle. Also works when depositing items in the PC. Only the active bag's item list is recognized by the game's systems. For example, you cannot enter the Cinnabar Gym if the Secret Key is not in the active bag. Same for Stadium compatibility, detecting only the bag list that was active when last saved
    • Low HP alarm only plays three times then turns itself off
    • There is an Aide NPC in the viridian pokemon center that can toggle regular trainer randomization. Only affects regular trainers that use one level for all 'mons and have no custom movesets. Will replace their roster 'mons with random non-evolved 'mons (legendaries are excluded). The new mons will be swapped with their evolved forms if at a high enough level. This feature was added with the intent of spicing-up subsequent Gen-1 playthroughs
    • Added the Clause Brothers to Viridian City. They toggle enforcement of the item, sleep, and/or freeze clauses. The clauses apply to the player and AI equally, and only apply during non-link trainer battles. Sleep and freeze clauses work like they do in Pokemon Stadium
    • Revive items cannot be used in battle on SET style

    New Features (master & lite branch)
    • Made adjustments to critical hit damage so that it's never lower than non-crit damage
    • Bike music stops playing now when going down a hole
    • Forest tileset is now treated as an outside area
    • You can now cut the grass in the plateau tileset
    • When playing in GBC-mode, move animations are colored based on their type

    Hack-induced Fixes (master branch):
    • Slightly increased the possible coin payout for the the celadon hotel coin guy
    • Added a level-based multiplier to greatly increase the money offered to sell 'mons
    • Adjusted the level 0 moves of stone evolutions to play nicer with the move relearner
    • Butterfree, Venonat, and Venomoth can all learn HM05 instead of HM04
    • Fixed a menu return issue when forfeiting fights (particularly against the rival)
    • Fixed some BCD value payout weirdness
    • Fixed blackouts not applying when defeated by Prof Oak

    Hack-induced Fixes (master & lite branch):
    • Fixed scripted NPC-following movement in 60fps mode
    • Fixed some NPC ghosting in mart menus in GBC mode
    • Fixed rival facing in silph co after battle
    • Fixed issue with route 22 phantom rival appearing if the first battle was skipped
    • Stopped AI from decrementing PP on item usage and switching
    • Stopped AI from decrementing PP when it doesn't wake up from sleep
    • Fixed crash damage being zeroed for the jump kick effects
    • Fixed stat exp not being applied properly

    Misc Adjustments (master branch)
    • Amber and fossils are now non-key items
    • Trapping moves play a 'poof' animation on the final turn instead of a cry (changed for the hearing impared)
    • Gave the strength quick-key a visual cue and sfx

    Misc Adjustments (master and lite branch)
    • Greatly increased the speed and performance of spin tiles
    • Gave AI layer 3 to Juggler
    • AI layer 1: discourage exploding effects if faster than a player in fly/dig state
    • AI layer 1: randomly discourage usage of 2-turn moves when confused/paralyzed
    • AI Layer 1: 50% chance that the AI is blind to a player switching or using an item
    • AI layer 3: added some strategy to handle when the player uses fly/dig
    • AI layer 3: slightly preference regular effectiveness moves if STAB exists (25% chance per move)
    • AI switch scoring now penalizes bad match-ups between player and enemy 'mon types
     
    536
    Posts
    4
    Years
    • Seen May 13, 2024
    Okay, I've lolligagged enough. Version 1.22 has been released.

    There is now a "Guide to New Player Functions" for instructions on all the new stuff the player can do in the Master branch.

    Master Branch Changelog
    #Hack-Induced Bugfixes & Adjustments since last version:
    -----------
    - Slightly increased the possible coin payout for the the celadon hotel coin guy
    - Added a level-based multiplier to greatly increase the money offered to sell 'mons
    --> Interestingly, this makes it so you no longer need to grind battles to train a post-game team
    --> Catch pokemon, sell them for money, then spend it on vitamins and rare candy in the Celadon mart
    --> Since vitamins have no limit in the post-game, you can max levels and stat exp via this funding method
    - Adjusted the level 0 moves of stone evolutions to play nicer with the move relearner

    - Butterfree, Venonat, and Venomoth can all learn HM05 instead of HM04
    - Fixed a menu return issue when forfeiting fights (particularly against the rival)
    - Fixed some BCD payout wierdness
    - Getting max base exp for enemies > lvl 100 is now based on level cap instead

    - Fixed scripted NPC-following movement in 60fps mode
    - Fixed some NPC ghosting in mart menus in GBC mode
    - Applied Rangi's reformatting to key item bit fields
    - Removed the redundant overflow check on the celadon hotel coin guy
    - Consolidated the code used for stat scaling
    - Fixed rival facing in silph co after battle
    - Fixed issue with route 22 phantom rival appearing if the first battle was skipped
    - Stopped AI from decrementing PP on item usage and switching
    - Stopped AI from decrementing PP when it doesn't wake up from sleep
    - Bank $13 is now solely used for trainer pics
    - Fixed crash damage being zeroed for the jump kick effects
    - Fixed stat exp not being applied properly
    - Fixed blackouts not applying when defeated by Prof Oak


    #New features & adjustments since last version:
    -----------
    - Amber and fossils are now non-key items
    - Trapping moves play a 'poof' animation on the final turn instead of a cry (changed for the hearing impared)
    - Gave the strength quick-key a visual cue and sfx
    - Removed the word "only" from NPC on Silph Co 5f who talks about trade evos
    - Text tweak to route 14 trainer with regards to forgetting HMs
    - Gave AI layer 3 to Juggler

    - The bag now supports an additional item list for an extra 20 slots of space
    --> Press START on the bag menu to hot-swap the item list that populates the active bag
    ----> Also works in battle
    ------> Also works when depositing items in the PC
    --> Only the active bag's item list is recognized by the game's systems
    ----> For example, you cannot enter the Cinnabar Gym if the Secret Key is not in the active bag
    ------> Same for Stadium compatibility, detecting only the bag list that was active when last saved
    - Low HP alarm only plays three times then turns itself off
    - There is an Aide NPC in the viridian pokemon center that can toggle regular trainer randomization
    --> Only affects regular trainers that use one level for all 'mons and have no custom movesets
    --> Will replace their roster 'mons with random non-evolved 'mons (legendaries are excluded)
    --> The new mons will be swapped with their evolved forms if at a high enough level
    --> This feature was added with the intent of spicing-up subsequent Gen-1 playthroughs
    - Added the Clause Brothers to Viridian City
    --> They toggle enforcement of the item, sleep, and/or freeze clauses
    --> The clauses apply to the player and AI equally, and only apply during non-link trainer battles
    --> Sleep and freeze clauses work like they do in Pokemon Stadium
    - Revive items cannot be used in battle on SET style
    - When playing in GBC-mode, move animations are colored based on their type
    - Red & Blue versions use the back sprites from spaceworld 97 so as to be cohesive with the front sprites

    - AI layer 1: discourage exploding effects if faster than a player in fly/dig state
    - AI layer 1: randomly discourage usage of 2-turn moves when confused/paralyzed
    - AI Layer 1: 50% chance that the AI is blind to a player switching or using an item
    - AI layer 3: added some strategy to handle when the player uses fly/dig
    - AI layer 3: slightly preference regular effectiveness moves if STAB exists (25% chance per move)
    - Greatly increased the speed and performance of spin tiles
    - Adjusted some of Giovanni's final lines for clarity
    - Added some underflow and overflow protection to switch scoring
    - AI switch scoring now penalizes bad match-ups between player and enemy 'mon types
    - Minor adjustments to switch scoring

    - Made adjustments to critical hit damage
    --> Damage factor is now 2*(2*level)/5 + 4 instead of 2*(2*level)/5 + 2 to simplify some algebra
    --> If non-crit damage would be >= crit damage, the regular modified stat values are applied instead
    - Bike music stops playing now when going down a hole
    - Can no longer walk up to 4 steps with a fainted team
    - Fixed a conflict where transforming while disabled can leave the new moves disabled
    - Fixed transformed 'mons reseting their moves when learning a level-up move
    - Fixed a typo so now transformed 'mons retain their original palette
    - PP-restoring items no longer affect transformed moves and only restore the original moves
    - Fixed-damage move effects now use 2 bytes for damage instead of 1
    - Fixed Psywave underflow/overflow with levels of 0, 1, and above 170
    - Fixed an issue with Disable's counter on slower 'mons
    - Fixed an issue with the silph co 11f elevator doors
    - Non-link enemy mons now have PP, so always run checks for 0 PP during disable effect
    - Fixed a missed increment that makes a map's 15th object not update its facing properly
    - Adjusted two spin-stop tiles in Viridian Gym
    - Made Agility's animation more apparent
    - Water warps in seafoam island 4 & 5 are now scripted movement
    - Forest tileset is now treated as an outside area
    - Fixed a bug in the GetName: function that treated lists over 195 entries as item lists
    - You can now cut the grass in the plateau tileset


    Lite Branch Changelog
    #Latest Fixes (most recent ips patch):
    ---------------
    - Fixed scripted NPC-following movement in 60fps mode
    - Fixed some NPC ghosting in mart menus in GBC mode
    - Greatly increased the speed and performance of spin tiles
    - Fixed rival facing in silph co after battle
    - Fixed issue with route 22 phantom rival appearing if the first battle was skipped
    - Stopped AI from decrementing PP on item usage and switching
    - Stopped AI from decrementing PP when it doesn't wake up from sleep
    - Fixed a conflict where transforming while disabled can leave the new moves disabled
    - Fixed an issue with the silph co 11f elevator doors
    - Bike music stops playing now when going down a hole
    - Can no longer walk up to 4 steps with a fainted team
    - Fixed a typo so now transformed 'mons retain their original palette
    - Fixed transformed 'mons reseting their moves when learning a level-up move
    - PP-restoring items no longer affect transformed moves and only restore the original moves
    - Made adjustments to critical hit damage
    --> Damage factor is now 2*(2*level)/5 + 4 instead of 2*(2*level)/5 + 2 to simplify some algebra
    --> If non-crit damage would be >= crit damage, the regular modified stat values are applied instead
    - Fixed a missed increment that makes a map's 15th object not update its facing properly
    - Adjusted two spin-stop tiles in Viridian Gym
    - Adjusted some of Giovanni's final lines for clarity
    - Made Agility's animation more apparent
    - Water warps in seafoam island 4 & 5 are now scripted movement
    - AI layer 1: discourage exploding effects if faster than a player in fly/dig state
    - AI layer 1: randomly discourage usage of 2-turn moves when confused/paralyzed
    - AI Layer 1: 50% chance that the AI is blind to a player switching ir using an item
    - AI layer 3: added some strategy to handle when the player uses fly/dig
    - AI layer 3: slightly preference regular effectiveness moves if STAB exists (25% chance per move)
    - Special damage effect now uses 2 bytes for damage instead of 1
    - Fixed Psywave underflow/overflow with levels of 0, 1, and above 170
    - Applied Rangi's reformatting to key item bit fields
    - Consolidated the code used for stat scaling
    - Added AI layer 3 to Juggler
    - Forest tileset is now treated as an outside area
    - Added some underflow and overflow protection to switch scoring
    - Fixed an issue with Disable's counter on slower 'mons
    - Fixed a bug in the GetName: function that treated lists over 195 entries as item lists
    - AI switch scoring now penalizes bad match-ups between player and enemy 'mon types
    - Minor adjustments to switch scoring
    - Can now cut grass in the plateau tileset
    - Fix jump kick effect doing 0 crash damage
    - On GBC, moves animations are colored according to type
     

    JOBO

    o/_\O
    633
    Posts
    9
    Years
  • The update looks awesome and I appreciate all the hard work! Would it be possible to have a master branch ips with the vanilla sprites included in the downloads? I'm awful with github stuff and can never seem to figure that out. The previous releases were with the og sprites so I was hoping that would be an option. I'm really glad you're still pushing updates! Cheers
     
    536
    Posts
    4
    Years
    • Seen May 13, 2024
    The update looks awesome and I appreciate all the hard work! Would it be possible to have a master branch ips with the vanilla sprites included in the downloads? I'm awful with github stuff and can never seem to figure that out. The previous releases were with the og sprites so I was hoping that would be an option. I'm really glad you're still pushing updates! Cheers

    I've uploaded "_origback" alternative patches for red & blue. Using these instead of the regular master patches will keep the original back sprites.
     
    Back
    Top