lashoun / upgraded-fefates-randomizer

An Upgraded Fire Emblem Fates Randomizer
GNU General Public License v3.0
9 stars 0 forks source link

Upgraded FEFates Randomizer

This is a barbaric but working improvement of thane89's Fire Emblem Fates Randomizer.

Screenshots

Features

On the one hand, I refined the randomizer's algorithm in order to provide a more enjoyable game experience. The biggest selling point is the possibility to do a Pick My Units run: if you wish, you can use the -pmu option to get a PMU list of 16 units to use, that you will find in the PMUClassSpread.csv file generated by the script.

On the other hand, I set out to upgrade the whole Fire Emblem experience (visuals, Birthright difficulty, weapons, classes). Those upgrades are optional.

Randomizer Features

By default the randomizer works as explained below. Customizations are possible with the many options provided; if you do not understand, you may also read the code, which should be relatively easy to grasp.

Upgraded Fates Features

Mods and visuals

All credits are due to the original mod authors.

Chapters

Weapons

Characters

Classes

Data HP Str Mag Skl Spd Lck Def Res Mov
Bases 16 6 7 7 7 4 4 5 6
Growths 0 10 20 10 10 10 0 10 -
Max Stats 48 29 33 29 31 29 26 30 -
Pair Up Bonuses - 0 3 0 2 0 0 1 1
Data HP Str Mag Skl Spd Lck Def Res Mov
Bases 20 10 0 9 7 4 9 3 6
Growths 20 15 0 20 10 5 15 0 -
Max Stats 65 36 25 34 29 32 35 29 -
Pair Up Bonuses - 3 0 3 0 0 2 0 0

Shops

Instructions

Requirements

You will need to install Python, numpy and the xmltodict module. I advise using virtual environments but for the layman a simple

pip install numpy xmltodict

should do the trick. The instructions can look daunting but once you understand how it works it takes fewer than 5 minutes to do. Some experience with Python and/or tinkering with files will obviously help though.

  1. Begin by either cloning the repository or downloading and extracting the zip.

  2. First, choose which version of Fates you want to play (all versions except Vanilla are only compatible with the Special Edition, unfortunately):

    • Vanilla Fates: for copyright-related reasons, you will have to dump your own romfs. Follow the instructions in thane89's original readme below. Copy the castle, GameData, m, Scripts folders into a folder that will be hence called the romfs folder.
    • Upgraded Fates (recommended): patched with my curated upgrades listed above. No need to dump any romfs in that case! Extract all the .7z archives, i.e., fates_upgraded_decompressed.7z into a fates_upgraded_decompressed folder and fates_upgraded_fixed{/2/3}.7z into a single fates_upgraded_fixed folder. The fixed folder contains mainly visuals and things the randomizer does not affect so you do not have to manipulate it until step 12. The decompressed folder will henceforth be referred to as the romfs folder.
  3. Run Fates Randomizer Beta 5-5.jar, click "Open and Verify", and select the romfs folder. You should see a new window pop up with options. If you do not, the window will show you which file was not found. Make sure that the selected folder has folders named castle, GameData, m, Scripts directly inside it.

  4. Select a path and options. Refer to the original post if you do not understand an option. I recommend selecting All Routes (even if you plan to play Birthright or Conquest, the Python script has route options too) and all options except the experimental ones and the stat randomization.

  5. Hit "Randomize" and let the program sit. When the program finishes, a little notification will pop up in the corner of the window.

  6. Close Fates Randomizer Beta 5-5.jar.

  7. Copy the RandomizerSettings.xml file from the romfs folder to the data folder.

  8. Open a command prompt in the same folder as updated_randomizer.py. Run

    python updated_randomizer.py
    • If you want to know about the options, type:
      python updated_randomizer.py -h
    • Refer to the section "All Options" below for the details.
    • If you did not select the option "Anna" / "Amiibo characters" / "Children" in the randomizer, you have to use the options -ba / -bac / -bc respectively.
  9. If the script ran successfully, you should have three files named RandomizerSettingsUpdated.xml, ClassSpread.csv and PMUClassSpread.csv in the data folder. Otherwise, try to run one more time, and if it fails again, raise an issue on this repository.

    • RandomizerSettingsUpdated.xml contains the detailed information of the randomized run. For each character, the StringData and ClassData fields are tied to the character while the other fields are tied to their spot. If Ryoma has as "switchingCharacter" Hinata, he will have the stats that are written in Hinata's Stats field (but those stats will have been computed as Ryoma's "expected" stats at this spot). I recommend not looking at it for more fun.
    • ClassSpread.csv contains on each line the original character, their replacement and the class assigned to the replacement. I recommend respecting the file's assignements for more fun and challenge.
    • PMUClassSpread.csv (if you selected the -pmu option) contains a PMU subset of the previous file.
  10. Delete the romfs folder and repeat steps 1-5 but, in step 3, choose "Custom Path" and select RandomizerSettingsUpdated.xml. Check the "Join Order" options, otherwise the randomization will not be complete. (In particular, the characters will have the same weapons as vanilla when they join, which is problematic if their class changed as they will not be able to use them.) The randomizer should after clicking the Randomize button. In the rare case where it does not, it means that the xml file isn't legal (despite extensive testing I could not make the Python script 100% compliant); re-running the Python script should fix this in most cases. If the problem persists, simply repeat the whole procedure from step 1.

  11. Close Fates Randomizer Beta 5-5.jar. Open FEAT.exe. Drag the romfs folder into FEAT: this will recompress the files. Once FEAT is done, you can close it.

  12. Phew! You're done! Now you can copy your romfs folder to the mods folder of your gaming medium. If you chose the upgraded version, also copy the contents of the fixed folder inside the romfs folder if you did not do so already, and the exefs folder to the mods folder.

  13. As a final note, DO NOT use this on top of an existing save or branch of fate. Use a fresh save starting from the very beginning if you want a stable playthrough.

All Available Options

usage: updated_randomizer.py [-h] [-ap ADDMAX_POW] [-ab] [-ads] [-ba] [-bac] [-bc] [-bdc] [-bdcs]
                             [-bscap BASE_STAT_CAP] [-bssmax BASE_STATS_SUM_MAX] [-bssmin BASE_STATS_SUM_MIN] [-bw]
                             [-c CORRIN_CLASS] [-dbsr] [-dcd] [-dcs] [-dfu] [-dgd] [-dlts] [-dl] [-dlsc] [-dms]
                             [-dpc DEBUFF_PREPROMOTES_COEFF] [-drl] [-drlu] [-drr DEF_RES_RATIO] [-drsgs] [-ds] [-dsr]
                             [-dss] [-edbc] [-egd] [-ema] [-emoc] [-epa] [-erps] [-esc] [-esd] [-esi] [-ev] [-evc]
                             [-g {Revelations,Birthright,Conquest}] [-gc GROWTH_CAP] [-gp GROWTH_P]
                             [-gsmax GROWTHS_SUM_MAX] [-gsmin GROWTHS_SUM_MIN] [-ic IMPOSED_CLASSES]
                             [-mc MODIFIER_COEFFICIENT] [-mp MOD_P] [-np N_PASSES] [-ns {-1,0,1,2,3,4,5}] [-pmu]
                             [-s SEED] [-sp STAT_P] [-sadp SWAP_ATK_DEF_P] [-sdrp SWAP_DEF_RES_P] [-slp SWAP_LCK_P]
                             [-sssp SWAP_SKL_SPD_P] [-ssmp SWAP_STR_MAG_P] [-v]

optional arguments:
  -h, --help            show this help message and exit
  -ap ADDMAX_POW, --addmax-pow ADDMAX_POW
                        the lower the more uniform growth adjustment
  -ab, --allow-ballistician
                        allow Ballistician class in the randomization
  -ads, --allow-dlc-skills
                        allow DLC skills in skill randomization
  -ba, --ban-anna       ban Anna
  -bac, --ban-amiibo-characters
                        ban Amiibo characters (Marth, Lucina, Robin, Ike)
  -bc, --ban-children   ban children characters
  -bdc, --ban-dlc-classes
                        ban DLC classes
  -bdcs, --ban-dlc-class-skills
                        ban DLC class skills in skill randomization
  -bscap BASE_STAT_CAP, --base-stat-cap BASE_STAT_CAP
                        if adjusting growths, max value for base stat
  -bssmax BASE_STATS_SUM_MAX, --base-stats-sum-max BASE_STATS_SUM_MAX
                        if adjusting growths, decreasing stats sum to that value
  -bssmin BASE_STATS_SUM_MIN, --base-stats-sum-min BASE_STATS_SUM_MIN
                        if adjusting growths, increasing stats sum to that value
  -bw, --ban-witch      ban Witch class from the randomization
  -c CORRIN_CLASS, --corrin-class CORRIN_CLASS
                        Corrin's final class
  -dbsr, --disable-balanced-skill-randomization
                        disable balanced skill randomization; skill randomization will be completely random
  -dcd, --disable-camilla-def
                        disable Camilla's replacement's enforced higher Def than Res
  -dcs, --disable-class-spread
                        disable diverse class reroll
  -dfu, --disable-fates-upgraded
                        disables the assumption that you are playing Fates Upgraded; important for DLC class handling
  -dgd, --disable-gunter-def
                        disable Gunter's replacement's enforced higher Def than Res
  -dlts, --disable-livetoserve
                        disable the retainers' replacements' enforced Live to Serve skill
  -dl, --disable-locktouch
                        disable Kaze and Niles' replacements' enforced Locktouch skill
  -dlsc, --disable-limit-staff-classes
                        disables replacing staff only classes by offensive classes and setting the staff only class as
                        a reclass option
  -dms, --disable-model-switch
                        disable model switching but keep switching the rest of the data (stats, growths...)
  -dpc DEBUFF_PREPROMOTES_COEFF, --debuff-prepromotes-coeff DEBUFF_PREPROMOTES_COEFF
                        percentage points of handicap for prepromote base stats
  -drl, --disable-rebalance-levels
                        disable fairer level balance adjustments (reverts to levels from the original games)
  -drlu, --disable-rng-level-ups
                        disable rng level ups; characters will have average stats w.r.t their growths
  -drr DEF_RES_RATIO, --def-res-ratio DEF_RES_RATIO
                        ratio of higher def/res characters with mixed classes
  -drsgs, --disable-randomize-stats-growths-sum
                        will disable randomizing stats and growths sum for each character between customizable bounds
  -ds, --disable-songstress
                        disable Azura's replacement's enforced Songstress class
  -dsr, --disable-staff-retainer
                        disable Jakob and Felicia's replacement's enforced healing class
  -dss, --disable-staff-early-recruit
                        disable Sakura and/or Elise's replacement's enforced healing class
  -edbc, --enable-dlc-base-class
                        will give unpromoted base classes to every DLC class for game balance (eg Ninja/Oni Savage for
                        Dread Fighter)
  -egd, --enable-genderless-dlc
                        allows DLC classes to be given regardless of gender. Will automatically trigger --enable-dlc-
                        base-class since this will affect only unpromoted characters; prepromoted characters are
                        banned from getting an illegal class since the randomizer doesn't support it
  -ema, --enforce-mozu-aptitude
                        enforce Mozu (herself) having Aptitude
  -emoc, --enable-mag-only-corrin
                        enables Corrin to get a Mag only class
  -epa, --enforce-paralogue-aptitude
                        enforce Mozu's replacement to have Aptitude
  -erps, --enable-randomized-personal-skills
                        will output recommended personal skills; you will have to manually edit them, e.g. using
                        thane98's Paragon. Requires the `disable-class-spread` tag to NOT be passed
  -esc, --enforce-sword-corrin
                        enforces Corrin to get a sword-wielding final class
  -esd, --enforce-stat-decrease
                        enforces stat decrease to base stat sum max regardless of growth increase
  -esi, --enforce-stat-increase
                        enforces stat increase to base stat sum min
  -ev, --enforce-villager
                        enforce Mozu's replacement being a Villager with Aptitude
  -evc, --enforce-viable-characters
                        will force you to play with only the first 15 characters encoutered by giving 0 growth rates
                        to the others in the route; non-viable characters will be given the 'Survey' skill for easy
                        identification
  -g {Revelations,Birthright,Conquest}, --game-route {Revelations,Birthright,Conquest}
                        game route, especially important to specify it if playing Revelations so that levels are the
                        correct ones
  -gc GROWTH_CAP, --growth-cap GROWTH_CAP
                        adjusted growths cap
  -gp GROWTH_P, --growth-p GROWTH_P
                        probability of editing growths in a variability pass
  -gsmax GROWTHS_SUM_MAX, --growths-sum-max GROWTHS_SUM_MAX
                        will adjust growths until sum is lower than specified value
  -gsmin GROWTHS_SUM_MIN, --growths-sum-min GROWTHS_SUM_MIN
                        will adjust growths until sum is higher than specified value
  -ic IMPOSED_CLASSES, --imposed-classes IMPOSED_CLASSES
                        list of imposed classes separated by a comma
  -mc MODIFIER_COEFFICIENT, --modifier-coefficient MODIFIER_COEFFICIENT
                        will increase all modifiers by specified coefficient
  -mp MOD_P, --mod-p MOD_P
                        probability of editing modifiers in a variability pass
  -np N_PASSES, --n-passes N_PASSES
                        number of variability passes (swap +/- 5 growths, +/- 1 stats and mods per pass
  -ns {-1,0,1,2,3,4,5}, --n-skills {-1,0,1,2,3,4,5}
                        number of randomized skills; if -1, randomize existing skills
  -pmu, --pmu-mode      `ClassSpread.csv` will only contain the 16 allowed characters for the run
  -s SEED, --seed SEED  RNG seed
  -sp STAT_P, --stat-p STAT_P
                        probability of editing stats in a variability pass
  -sadp SWAP_ATK_DEF_P, --swap-atk-def-p SWAP_ATK_DEF_P
                        probability of swapping Str/Mag (higher one) with Def/Res (higher one) growths / stats /
                        modifiers
  -sdrp SWAP_DEF_RES_P, --swap-def-res-p SWAP_DEF_RES_P
                        probability of swapping Def and Res growths / stats / modifiers
  -slp SWAP_LCK_P, --swap-lck-p SWAP_LCK_P
                        probability of swapping Lck and a random stat's growths / stats / modifiers; random if between
                        0 and 1, else [(Lck Growth)% and swap only if Lck is superior]
  -sssp SWAP_SKL_SPD_P, --swap-skl-spd-p SWAP_SKL_SPD_P
                        probability of swapping Skl and Spd growths / stats / modifiers
  -ssmp SWAP_STR_MAG_P, --swap-str-mag-p SWAP_STR_MAG_P
                        probability of swapping Str and Mag growths / stats / modifiers; random if between 0 and 1,
                        else according to class (coin flip for mixed classes)
  -v, --verbose         print verbose stuff

Example Custom Run

python updated_randomizer.py -bc -bssmin 15 -bssmax 20 -dms -edbc -egd -epa -erps -g "Birthright" -gsmax 350 -gsmin 280 -ic "Enchanter,Warden" -mc 5 -ns 4 -pmu

This example command (that I personally use) will ensure the following:

Troubleshooting

Chapter 2: There's an immobile "phantom" unit near the top left corner!

This sometimes happens. Just kill it after the others, you should be able to.

Chapter 5: This chapter is way too hard!

I advise using the Infinite Movement cheat code for this chapter. If you can play Randomized Fates, you can probably find how to use cheats on your gaming medium.

Conquest Chapter 9: Talking with Nyx crashes the game!

Break the wall near Nyx before talking to her.

Conquest Chapter 16: The game freezes after the "Spare Shura" prompt!

You need to rename or delete the file Scripts/B/B016.cmb. This might skip the prompt in its entirety, meaning you won't get anything, but at least you can play the rest of the route.

Revelations Chapter 8: Hayato was not replaced!

This is an issue from the original randomizer; I can't fix it myself. This can amusingly lead to recruiting two Hayatos.

Revelations Chapter 13: The obstacles are invisible!

This is a known issue. No fix for this at the moment.