Learn Japanese To Survive - Hiragana Battle

Learn Japanese To Survive - Hiragana Battle

Not enough ratings
Fix compatibility with 64-bit macOS ( Big Sur - including M1 ! )
By KittyAuntie
"Your current macOS version is unable to run 32-bit games. This game may not run."

...except it WILL run, if you do a little legwork! This guide tells you how. It's not hard!
   
Award
Favorite
Favorited
Unfavorite
Why the game won't currently (Sep 19, 2021) run on 64-bit macOS
Hiragana Battle is written as a Web app using nwjs— that's right, HTML and Javascript! The game is bundled with a precompiled version of nwjs which does not work on modern 64-bit macOS.

By replacing this bundled nwjs with a new version of nwjs, we can make the game work on our fancy new Big Sur M1 goodness. (Intel too!)
Fixing the app for 64-bit macOS
Here's how to get this game working on 64-bit macOS, including Big Sur (tested working on Intel and M1 Macs). This guide requires familiarity with the command line, so get Terminal.app or your favourite alternative terminal program handy.

1) Install nwjs (https://nwjs.io/). If you already have homebrew installed, just go "brew install nwjs"; it will end up in /Applications/nwjs.app.
2) Change directory into the Contents dir within your local copy of the app. 3) Move the "Frameworks" and "MacOS" directories out of the way.
mv Frameworks Frameworks.orig ; mv MacOS MacOS.orig
4) Copy over the newly installed copy of nwjs. 5) Copy over the old Frameworks dir, but replace the main nwjs Framework with the new version.
cp -pRv Frameworks.orig Frameworks ; rm -rf Frameworks/nwjs\ Framework.framework ; cp -pRv /Applications/nwjs.app/Contents/Frameworks/nwjs/ Framework.framework Frameworks/


At this point, the game should work, but SAVING WILL BE BROKEN. As in, completely broken. To fix this:

6) Edit ~/Library/Application Support/Steam/steamapps/common/HiraganaBattle/HiraganaBattle.app/Contents/Resources/app.nw/js/rpg_managers.js ; search for the line that begins:
var path = window.location.pathname.replace
On that line, change the text "/save/" to a full path, e.g.: 7) mkdir the directory from above, e.g.: 8) Try running the game again from Steam! It should work.

Enjoy!
7 Comments
Angel__xo 14 May @ 6:22am 
Worked on my M1 mac, with Node.js and npm already installed (for work). Thanks to CrimsonFairy for the help with the forward slash and username change which I would have missed otherwise :-)
rdomain 23 Mar @ 1:52am 
Hopefully I'll get to try this when time allows. I bought all 3 quite a while ago but could never run any of them on my Mac. Thank you. Hopefully I can get it working.
darthtanner 20 Mar, 2024 @ 7:48am 
Thank you for this info! I had some issues with nwjs working like you described however.

The latest nwjs.app doesn't appear to be signed correctly, and I can't get it to work on my local machine. After a ton of tinkering I ended up running nwjs by using node.js, 'npx nw' and specifying the app.nw folder inside the app. It is a bit involved, but I got it working. I also did some tinkering with it to get it to work for other users on my Mac mini so my kids could play it.

I started using environment variables for the save location.
[code] var path = window.location.pathname.replace(/(\/www|)\/[^\/]*$/, `${process.env.HOME}/Library/Application Support/Steam/steamapps/common/HiraganaBattle/HiraganaBattle.app/Contents/Resources/app.nw/save/`); [/code]
CrimsonFairy 11 Nov, 2023 @ 9:34pm 
MAC ERROR FIX

This was a great help in fixing the issue I had on my Mac. I found some smaller errors in your mini tutorial and wanted to point them out so others in future have easier time.

In step 5, last line, change the forward slash between, .../nwjs and Framework.framework to a back slash. this is a spacing thing in terminal

Nano: (built-in text editor in terminal for mac) How to edit files in the Terminal (Mac & Linux)
paste this in this line in the terminal to continue the original editing of the rpg_managers.js file:
nano ~/Library/Application\ Support/Steam/steamapps/common/HiraganaBattle/HiraganaBattle.app/Contents/Resources/app.nw/js/rpg_managers.js

Go several pages over and you will find the part you need to edit is below the "Storage Manager" section.

In Steps 6 and 7 when it shows the directory. change, 'ticker' to your username which can be found under /Users directory. as this would have been their original username.
KavaKava 20 Oct, 2023 @ 4:21pm 
thank you for this! just what i needed.. it plays fine on my pc but not mac, now i know why. will give this fix a go
Riceball 25 Oct, 2022 @ 3:14pm 
I am not a Mac user but randomly stumbled upon your tutorial. As someone who love this little game I wanna thank you for the help you are providing here. Even if it helps just one or two people I am sure that they are plenty thankful for that. :ponyisland:
thoromyr 5 Nov, 2021 @ 4:54pm 
I tried to cheat by using Learn Katakana (which works) as the source, but that did not work out. Downloading the app & following the steps a second time did the trick.

thanks!