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

Boss Battle Balancing

247
Posts
6
Years
    • Seen yesterday
    Have you ever thought: "Man, the boss battles are just too easy in these Pokemon games!" Have I got the solution for you! I've gathered and created a collection of code that you can put in your decomp so that any battle of your choosing can be a bit more challenging, but not unfairly so. I've broken them up into a few sections, so you can pick and choose which elements that you want to implement.

    1. Level Balancing
    Spoiler:


    2. Item Balancing
    Spoiler:


    3. Pokemon Count Balancing
    Spoiler:


    Now it's time to show how to actually use all of this stuff. I'm going to apply this code to the Roxanne Gym Battle. This is in data/maps/RustboroCity_Gym/scripts.inc. Or you can just open up the script for RustboroCity_Gym in PoryMap:
    Spoiler:

    There you have it! With all three of these elements in play, you will have a much more challenging, but still fair, boss battle. You can also only use one or two of these elements, in case you find any one of them disagreeable. I hope you enjoy forcing your players to be more strategic and not grind for xp to breeze through your hacks!
     
    Last edited:
    180
    Posts
    6
    Years
    • Seen Apr 15, 2024
    Wow, this is so cool!
    I actually did something like this before, but I did it by preventing the challenger to enter the Gym with more than 3 Pokémon (excluding eggs), but it was very rough. This, on the other hand, is actually super cool, and I'd love to implement it! I'll still use the "not entering the gym" thing, so I can keep it consistent with the rest of my "Gym restrictions", but this'll come in handy!
     
    180
    Posts
    6
    Years
    • Seen Apr 15, 2024
    2. Item Balancing
    Spoiler:
    This does not work. In the "CB2_EndTrainerBattle" i got a message that says;
    src/battle_setup.c: In function `CB2_EndTrainerBattle':
    src/battle_setup.c:1953: warning: implicit declaration of function `LoadPlayerPa
    rty'
    src/battle_setup.c:1954: warning: implicit declaration of function `GiveBackItem
    sAndBerries'
    make: *** [Makefile:249: build/emerald/src/battle_setup.o] Error 1
     
    247
    Posts
    6
    Years
    • Seen yesterday
    This does not work. In the "CB2_EndTrainerBattle" i got a message that says;
    src/battle_setup.c: In function `CB2_EndTrainerBattle':
    src/battle_setup.c:1953: warning: implicit declaration of function `LoadPlayerPa
    rty'
    src/battle_setup.c:1954: warning: implicit declaration of function `GiveBackItem
    sAndBerries'
    make: *** [Makefile:249: build/emerald/src/battle_setup.o] Error 1

    I think I forgot to add in the src/battle_setup.c sections that you need to add
    Code:
    #include "load_save.h"
    #include "item.h"
    along with all of the other #include's. You'll also need to add
    Code:
    void GiveBackItemsAndBerries(void);
    to the end of include/item.h. I'll make those changes to the original post.
     
    Last edited:
    55
    Posts
    1
    Years
    • Seen today
    I couldn't seem to get this to work (maybe it's just the wording has been updated). What would I do if I wanted it to just limit the amount of pokemon in battle?
     
    247
    Posts
    6
    Years
    • Seen yesterday
    I couldn't seem to get this to work (maybe it's just the wording has been updated). What would I do if I wanted it to just limit the amount of pokemon in battle?

    What exactly isn't working? Does the ROM not compile, or does the feature not work as it's supposed to?
     
    55
    Posts
    1
    Years
    • Seen today
    That may be an issue of updated variable names, like you said. Would you mind sharing the full list of errors?

    I ran the code for just the pokemon limit on some clean files and managed to get it working. So disregard what I said earier, I likely edited the wrong parts XD
     
    55
    Posts
    1
    Years
    • Seen today
    So I have been running the code for Pokemon Removal perfectly fine but testing has revealed an error that I can't seem to fix. If you talk to a defeated gym leader, the pokemon are removed from the party again and are not returned.
     
    247
    Posts
    6
    Years
    • Seen yesterday
    So I have been running the code for Pokemon Removal perfectly fine but testing has revealed an error that I can't seem to fix. If you talk to a defeated gym leader, the pokemon are removed from the party again and are not returned.

    Is your code based off of the code I put in the spoiler beneath "In RustboroCity_Gym:", or the code in the spoiler beneath that? If it's the former, that one does indeed have that bug, since that script assumes if the player talks to the gym leader, they are starting the first gym battle. The code in the other spoiler shouldn't have that issue, as far as I can tell. Would you mind sharing all of the scripts you're using when interacting with the gym leader?
     
    55
    Posts
    1
    Years
    • Seen today
    Is your code based off of the code I put in the spoiler beneath "In RustboroCity_Gym:", or the code in the spoiler beneath that? If it's the former, that one does indeed have that bug, since that script assumes if the player talks to the gym leader, they are starting the first gym battle. The code in the other spoiler shouldn't have that issue, as far as I can tell. Would you mind sharing all of the scripts you're using when interacting with the gym leader?

    Just the first Spoiler section. Though I managed to fix it by calling a separate event script if the Gym is undefeated which seems to work so far.

    Good to know your other script fixes it though, just thought I would mention it in case it affected anyone else.
     
    247
    Posts
    6
    Years
    • Seen yesterday
    Just the first Spoiler section. Though I managed to fix it by calling a separate event script if the Gym is undefeated which seems to work so far.

    Good to know your other script fixes it though, just thought I would mention it in case it affected anyone else.

    Thanks for bringing this to my attention, though. I've added a warning to the main post to point out this issue with the code in the first spoiler.
     
    247
    Posts
    6
    Years
    • Seen yesterday
    I just made a few changes to the Pokémon Count and Item Balancing sections. You no longer need to have the Empty variable in the SaveBlock1 struct, and I added a macro to simplify the process of taking a player's items and giving the player the same items as their opponent. There is also a bug fix for Item Balancing, where TakeAwayItemsAndBerries didn't look at the correct pocket.
     
    55
    Posts
    1
    Years
    • Seen today
    Code Addendum to limit all trainer battles:
    Open data/scripts/trainer_battle.inc
    Find EventScript_ShowTrainerIntroMsg, go to waitbuttonpress and underneath put the script
    Code:
    setflag FLAG_STARTED_BOSS
    	special SavePlayerParty
    	deletepokemon 6

    Change 6 to appropriate number

    Find EventScript_DoTrainerBattle, go to gotobeatenscript and above put the script
    Code:
    savepartofteam
    	special LoadPlayerParty
    	loadpartofteam
    	clearflag FLAG_STARTED_BOSS

    EDIT: When set up like this, I am not able to have custom party sizes for Gym Battles, will get back to you when I work it out.
     
    Last edited:
    55
    Posts
    14
    Years
    • Seen Feb 1, 2023
    For some reason, when I used (a modified version of) the Item Balancing algorithm, the bag breaks.
    1. selecting an item causes the game to reset
    2. scrolling down to the Close option causes the game to freak out (music lags, the palette/colors flip, and eventually it crashes)



    Spoiler:


    Is there anything I'm missing and/or doing wrong? Any other ideas re: what is happening?

    Edit: Ok, so nevermind. I rolled back the Replace and Restore functions and the issues were still appearing. I was able to then narrow it down to a stupid change I'd made. Sorry about the false alarm!


    (p.s. if someone knows how to make these images a little less extremely huge, let me know and I'll adjust them 😁)
     

    Attachments

    • Screen Shot 2022-09-26 at 2.47.27 PM.png
      Screen Shot 2022-09-26 at 2.47.27 PM.png
      13.5 KB · Views: 6
    Last edited:
    Back
    Top