Hello! I'd just like to immediately state that not everything in this tool is mine. This borrows code from two separate repos. Here is the repo for the solver itself (Azshene/THM_Solver), and here is the repo for the image parser (artur-ag/TreasureHuntParser). My code is any tweaks I made, along with the "start.py" script.
I'm uploading this for a few reasons. My initial motivation was the original solver had a few errors, and I fixed them and uploaded it here as a revised edition (hence the name UpdatedMonolithSolver). I then came back to this 2 years later after finding an automatic image converter (auto-parser) and updated everything to accomodate for it, in order to make this tool easier to use (by a few orders of magnitude).
To clarify, these instructions assume that you are using a computer with Windows. The script I wrote should work fine on both Linux and Mac, though I've never tested it (and don't plan to).
- Mac: You should know how to use terminal and change the working directory in order to pass Step 2. You should also know how to take screenshots and save them as a file in order to pass Step 3.1.
- Linux: If you're using Linux, then you know what you're doing. The differences in instructions are the same as Mac.
In any event that you run into issues with the script on a different operating system, refer to the instructions of the individual repositories.
Here is a video of me going over the instructions. These written instructions are newer, but should be mostly the same (except maybe Prerequisites and Installation).
Also know that you are free to contact me for whatever reason, whether you run into a problem with the program, want some tips for 100% completion, or simply want to talk. My contact information can be found in the Afterword.
In order to run this script, you must have
- Python 3.6 (or newer)
- NumPy
- OpenCV
If you have no clue what any of those mean, then:
- You can download the Anaconda distribution of Python. Here's the download link for Windows. This comes with NumPy preinstalled.
- If you're not comfortable giving Anaconda your email, you can download the latest version of Python instead.
Note that my video instructions uses Anaconda.
Also, don't forget to download the solver itself. Make sure you unzip it somewhere you can easily access (e.g. Downloads).
Open Anaconda prompt by searching "Anaconda" in the Windows search bar. Run the following command
pip install opencv-python
(Experienced developers might be wondering why I'm instructing users to use pip
instead of conda
. It's because I'm lazy and don't want to write instructions for conda
. For our purposes, there's no difference anyways.)
Open command prompt by searching cmd
in the Windows Search bar. Run the following commands
pip install numpy
pip install opencv-python
Either way, you should see a message telling you everything downloaded successfully.
You'll want to change your directory to the unzipped folder. If you don't know how to do that:
In File Explorer, go into the Monolith folder (the default title is "UpdatedMonolithSolver-main") and copy the directory link. For example, my directory looked like this
C:\Users\Daniel\Downloads\UpdatedMonolithSolver-main
Then in Anaconda prompt, type cd (whatever you just copied)
. For example, I would input this into my command prompt (press right click to paste)
cd C:\Users\Daniel\Downloads\UpdatedMonolithSolver-main
If you just unzipped without changing the destimation, type cd UpdatedMonolithSolver-main
again.
If you're running the solver in a drive other than your C drive, then you must move to it before cd will work properly. You can type (drive letter):
to do this. (If you don't understand what this means, then it probably doesn't apply to you.)
This step is where you actually start to use the solver. I highly recommend playing in Borderless Windowed mode since you will be pressing Alt+Tab a lot.
I also recommend muting the game in Volume Mixer and playing your own music, as this minigame's music will most likely drive you insane.
Start a game and take a picture of the board by pressing Prt Sc
. Then, pause the minigame by opening the controls (F3 on QWERTY layout).
You can also press Windows Key + Shift + S
Make sure your hammer is away from the board and that you include the full screen. This is what your screenshot should look like.
Notice how the hammer is out of frame in the bottom left corner
Save your paint as a PNG file (JPG works too). Name it something you can easily remember.
If you don't know how, here's a quick-and-dirty way
- Open up Microsoft Paint by searching "paint" in the Windows search bar.
- Paste with
Ctrl + V
- File -> Save As -> PNG
- Make sure you only save the image and not any extra background white space.
An even quicker and dirtier way is to paste into the DMs of a bot on Discord, clicking the image, "Open Original", and then saving it directly. Whichever way is easier.
If the image parser fails during this step, then be sure to read the next note. It includes alternate instructions.
Once that is all saved, go back to Anaconda prompt and type the following command
python start.py boardName
Replace boardName with whatever you named your screenshot. For example, I included a sample board in the screenshots folder; if I wanted to run the script on this board, I would input
python start.py testBoard
If you saved your image as a JPG, include .jpg with the board name.
If you get the above error, then run the following command.
pip install pillow
Skip this note and move to Step 4 if the parser worked fine for you.
Sometimes the parser may fail and generate an incorrect board. This shouldn't happen very often, but is nonetheless possible. If this is your case, go to the 'boards' folder and edit the file called out
. Refer to the following images for correctly making a board:
This is the board I have
And this is how I would recreate it
Note that 1=Gray, 2=Pink, 3=Orange, 4=Blue. Use 0 for open blocks.
Since the start.py script only takes images as input, you won't be able to use it. To get around this, input the following command into Anaconda prompt
python THM.py out
Feel free to shoot me a message if you're having trouble (see Afterword).
Manually making the board is an incredibly tedious process. If you have to do it from scratch consistently, then I recommend trying out this alternate solver (westpipe/treasurefinder).
Once the program is done, it should open a file explorer window with a lot of images titled "step" and some number. Follow those steps in order, starting from Step 0.
There is a small yellow box around the blob you should click.
Very rarely, the program may generate an incomplete solution. This is because the program is designed using the A* (A-Star) search algorithm, which stops running on its own after some time. By default, the program terminates once it has checked 5000 board states. If you ever run into this problem, input the following command into Anaconda prompt
python THM.py out 100 7500
That command will let the program check 7500 boards instead of 5000, increasing the likelihood of finding a more complete solution. It might take a few seconds longer though.
Note that this program does NOT account for your treasure! As soon as you see treasure, stop following the solver and do everything you can to uncover it, since this solver may not obtain it in the end. (Especially if it's a Monokub.)
As the title suggests, simply plan your next moves manually. You can edit the screenshot you're on if it helps. This is usually pretty easy to do straightforward.
You can also have the solver figure plan your moves for you.
- Head to the folder titles "boards".
- Duplicate the file named
out
. Rename it to something you can remember, such asregion
. - Open it with notepad and delete all its contents.
- Recreate a small area around the treasure (NOT THE WHOLE BOARD!). Refer to this note.
- Run the following command
python THM.py region
Change region
to whatever you named your duplicated file.
Either way, after you get your treasure successfully, you can take another screenshot of the board and go back to Step 3.
Double check the solution it gives you, especially in areas with uncovered treasure. Refer to this note for changing the board manually.
If you have to restart after clearing the entire board, then go to Step 3.
If you have to reopen Anaconda/command prompt again, then go to Step 2 instead.
I hope my explanation was as informative as it could be! The two repositories I borrowed from had their own instructions, but I felt like I should write my own to help streamline everything. Remember that this tool won't guarantee success immediately, and you will most likely have to retry this a few times.
If you run into any issues (or just wanna have a chat), then please feel free to shoot me a message. My Discord is danleman1337. Alternatively, you can add my Steam account if you prefer to use that instead (in case the link doesn't work, my friend code is 442227082).
Full credit to both authors I borrowed code from! Feel free to also modify and redistribute this as you wish. Released under MIT License.