chpoit / utsushis-charm

Easily import all of your Monster Hunter Rise charms to your armor set searcher of choice
MIT License
48 stars 5 forks source link
armor-set-search charm-importer charms google-tesseract mhr monster-hunter monster-hunter-rise monster-hunter-sunbreak nintendo-switch ocr rise sunbreak

[Github All Releases]() [Github All Releases]()

Utsushi's Charm

Whenever I look at Utsushi I feel like I can do anything. Unfortunately, when I need to register my charms, I can't lose myself in Utsushi's charm. Fortunately, now, with Utsushi's charm, I can lose myself in Utsushi's charm for longer.

- Utsushi Fan Girl, probably

This repo contains code that will allow you to extract all of your charms in Monster Hunter Rise from recordings taking with the switch's "save clip" feature.

It's called Utsushi's charm because I thought it would be funny to make a complementary "Utsushi's Armor Search System", but this armor set searcher exists. I might still try to port Athena's ASS for MHW to MHR, but for now this works for me.

Patch Notes (Updated April 25th 2023)

The rest of the patch notes can be found here

Usage

Video guides

Compatible websites

Requirements

Steps

  1. Unequip all jewels. You will create "fake" charms otherwise.
    • Item Box -> Manage Equipment -> Set Decorations -> Equipment Box -> Remove all (Press '-' on controller)
    • Don't ask, this is way out of scope for something that takes you 30 seconds to do.
    • It wont break your loadouts, if you re-equip them, they will be put back in.
  2. Download the release bundle and follow the Requirements section (Utsushis-Charm_vx_x.zip) (You should have done this already)
  3. Record clips similar to the following of you going through your charms. Try placing the UI in front of something that is very "flat" in color and doesn't have NPCs walking in front.
    • I can easily go through 2-3 pages of charms in 30 seconds.
    • Use a stopwatch on your phone if you have trouble timing the 30 seconds. I saved a clip every ~25 seconds.
    • Don't worry about passing over a charm multiple times. Duplicates will be removed at the end.

Example Clip

  1. Transfer the clips to your computer.
  2. Put the files in the inputs directory. If it does not exist, create it at the same place you can find utsushis-charm.exe.
    • It does not matter how many you have
    • The inputs directory can be changed by clicking the button
    • I haven't tried to see what would happen if there are clips that are not of the charm UI
  3. Run the utsushis-charm.exe (Double-click)
    • The app will start
    • Wait a little bit, it needs to extract some data (~5-15s)
  4. Enter the options you want relative to where your files are and the game language
  5. The program will run and do the following:
    1. Find all unique frames
    2. Extract Charms
    3. Apply known automatic fixes to the charms
  6. If there were errors in parsing, a new window will open
    • Follow the instructions on screen and correct any invalid skill names.
    • If a skill/charm has to be corrected, a window will open and request your input.
      • Pressing cancel skips the charm and moves to the next.
      • Pressing empty removes the skill.
      • Only valid skill names can be entered. Case Insensitive.
  7. The program is done running.
    • Normally, charms are automatically saved to the files listed in the console
    • You can directly copy the charms to your clipboard by clicking the button.
  8. Extra:
    • Sometimes tesseract is absolutely unable to read text, those charms will be logged in app.log and you can add them manually.
    • You can see a list of duplicate charms (if they exist) in the charms.duplicate.txt
    • If no charm errored, or you don't care about those charms, you should be able to open the charms.encoded.txt file and copy the contents into the import box of MHR-Wiki

Supported Game language:

Supported App Language:

Looking for people who can submit translations. Use this file and replace the messages appropriately if you are interested in contributing. Create a pull request to show up as a contributor within Github. I can add you in this readme if you only want to create an issue with the translations.

I am currently working on a translation to French.

Having translations for the instructions for other languages might be useful, but it will require lots of maintenance.

FAQ

Notes

Known issues

Troubleshooting

If the program starts and closes without anything happening, open the app.log file and use this section to try and fix your issues.

Simple issues:

Adding something to the path (Windows)

  1. Copy the path to the executable (Where the program was installed)
    • Don't put the executable file in the path, only where it is located
  2. type env in the Windows search bar
    • Alternatively type Edit environment variables for your account
  3. Press Enter
  4. Click on Environment Variables
  5. In User Variables, select Path
  6. Click Edit
  7. Click New
  8. Paste the path you copied previously in the new spot.
  9. Click Ok/Apply for every window you opened.
  10. Restart every terminal/command line, or reboot to make sure you'll have access to the new commands

How does this work

Using a combination of coding and algorithms, the developer was able to make drones fly without them crashing into each other.

In all seriousness, the work is done in a few broad steps:

  1. Take all the videos and apply a filter and crop them to a smaller resolution to keep only the important data, keeping around one frame per charm
  2. Out of those frames, get the slots, skills and skill levels
  3. Feed the Skills to Google Tesseract to extract the names
    • If it is not a known skill, try using known corrections to get the proper skill
    • If needed, ask the user for input on what the skill is
  4. Output the final list of charms

Contribute

TODOS:

Building the executable

Sometimes windows will lock some files for a while and there is nothing you can do about it other than wait.

Running from source

Common requirements:

Normal instructions apply once the application starts.

MacOS

"Old" x86 macs

You might need to follow the M1 instructions

New M1 macs

Disclaimer

I've tested this with MacOS Monterey 12.6 running on an M1 apple silicon and the app works like a charm (no pun intended), it should seamlessly work on an intel mac but I didn't test it. Also I've decided not to rely on the mac built-in version of python3 synce it is outdated and has issues with the tk libraries, which I had to update to make the app work. I've opted for a clean installation of python with brew.

Requirements

Make sure you have brew installed on your machine, to install brew follow the official guide. You should be able to launch the terminal and use it to follow trough, I'm writing this on the assuption you can use the terminal.

Setup

We need to install the latest version of python with an updated version of the tk libs since the one shipped on OSX are outdated, the steps in short are: install pyenv, install an updated tcl-tk lib, install python with such tcl-tk lib, finally install tesseract.

env \                    
  PATH="$(brew --prefix tcl-tk)/bin:$PATH" \
  LDFLAGS="-L$(brew --prefix tcl-tk)/lib" \
  CPPFLAGS="-I$(brew --prefix tcl-tk)/include" \
  PKG_CONFIG_PATH="$(brew --prefix tcl-tk)/lib/pkgconfig" \
  CFLAGS="-I$(brew --prefix tcl-tk)/include" \
  PYTHON_CONFIGURE_OPTS="--with-tcltk-includes='-I$(brew --prefix tcl-tk)/include' --with-tcltk-libs='-L$(brew --prefix tcl-tk)/lib -ltcl8.6 -ltk8.6'" \
  pyenv install 3.10.6

You should be good to go.

Running Utsushi's Charm

Linux

Windows

Extra command-line options

If you run from source, or call the executable from the terminal you can make use of the following flags/arguments to achieve different functionality.

Included data

mh-rise skills language - Feuille 1.csv

The file located in data\/mh-rise skills language - Feuille 1.csv is a slightly modified version of the file found here. It is provided in the repository to aid in the rebuild of skill files for those interested.

I added the new Sunbreak skills, but currently only english versions are available.