Skip to content

Instantly share code, notes, and snippets.

@eshrh

eshrh/vns-on-linux.md

Last active Aug 4, 2021
Embed
What would you like to do?
Personal guide to visual novels on linux

Concise visual novel setup on linux

also see this guide which has better compatibility. This guide is forked from it. written by kamui-7

This guide is very close to exactly how I run vn's on my setup. I can't guarantee it'll work for everyone (in fact, i can probably guarantee it's broken for someone/some game)

Packages i use

sudo pacman -S wine-staging giflib lib32-giflib libpng lib32-libpng libldap lib32-libldap gnutls lib32-gnutls mpg123 lib32-mpg123 openal lib32-openal v4l-utils lib32-v4l-utils libpulse lib32-libpulse libgpg-error lib32-libgpg-error alsa-plugins lib32-alsa-plugins alsa-lib lib32-alsa-lib libjpeg-turbo lib32-libjpeg-turbo sqlite lib32-sqlite libxcomposite lib32-libxcomposite libxinerama lib32-libgcrypt libgcrypt lib32-libxinerama ncurses lib32-ncurses libxslt lib32-libxslt libva lib32-libva gtk3 lib32-gtk3 gst-plugins-base-libs lib32-gst-plugins-base-libs lib32-gst-plugins-good vulkan-icd-loader lib32-vulkan-icd-loader -y

Note that the vulkan packages are optional.

winetricks

These are the winetricks dependencies i use:

winetricks d3dx9 dirac dotnet35 dotnet40 dxvk lavfilters vcrun2003 vcrun2005 vcrun2008 wmp9

Being extremely comprehensive in your vcruns isn't necessary since most game installers will have a function to auto-install the right vcrun version.

Select the default wineprefix, and navigate to the font window. You can either choose exactly which fonts you want, or go ahead and select cjkfonts if you're lazy like me. If fonts still don't work, follow the instructions here

Remove all wine DLL overrides with winetricks alldlls=default

winecfg

Typ winecfg and a window should pop up. Set the windows version to 7 or 10.

On the audio tab, make sure you choose the right audio devices to output from, and verify that it's pulseaudio if you use it. If you plan to run a lot of 64bit games, I'd suggest going to graphics and ticking "emulate a virtual desktop." This is also something good to try for general window bugs

Unpacking VNs

Untranslated VNs are commonly distributed in ISOs. Getting the game out of them is fairly straightforward.

mkdir ~/mnt
sudo mount game.iso ~/mnt
mkdir ./game-files
cp ~/mnt/* ./game-files -r

Make a directory called mount, mount the iso, and copy all the files to another folder.

If you encounter a bin/cue file, you can convert them to a standard .iso using a program like bchunk. MDF/MDS files also work the same way, but you might be able to directly mount the .mdf -- if it doesn't work, then use a program like mdf2iso.

From here it should be smooth sailing. Run the installer with

LC_ALL="ja_JP.UTF-8" TZ="Asia/Tokyo" wine setup.exe

and you should good.

Once the game's finished installing, you can run the game exe the same way. If you run into errors with the disk not being inserted, you'll probably have to use cdemu, the guide linked at the top of the page explains how to do it.

Text hooking

Head over to the textractor download site and download the English-only zip file. Save it somewhere safe, and you should be able to run the x86/Textractor.exe file with just the wine command.

Mining effectively

You can follow any windows guide to find out how to use textractor along with yomichan like this one. Your end goal is to be able to have a texthooker page open and have VN text automatically appear on it. You'll then be able to use yomichan to mine anki cards.

You might also want to include a voice clip and a screenshot of your visual novel along with your anki card. This can be done using ames. You should already have anki and ankiconnect installed, so install the following dependencies on your system (arch assumed):

sudo pacman -S pulseaudio pactl ffmpeg maim xdotool libnotify

  1. Then, download the ames.sh script somewhere safe
  2. Edit the script and change the first two lines to match the names of your Anki model image and audio fields.
  3. Bind the following commands to any key in your DE, WM, sxhkd, xbindkeysrc, etc.
    • sh ~/path/to/ames.sh -r: press once to start recording, and again to stop and export the audio clip to your latest-created Anki card.
    • sh ~/path/to/ames.sh -s: prompt for an interactive screenshot selection
    • sh ~/path/to/ames.sh -a: repeat the previous screenshot selection. If there is no previous selection, default to -s.
    • sh ~/path/to/ames.sh -w: screenshot the currently active window (requires xdotool)

Now, when you press a hotkey, ames should collect the screenshot or recording you selected, and export it to your last added card in Anki automatically, which should be a card you mined using Yomichan from the visual novel.

@bayazidbh

This comment has been minimized.

Copy link

@bayazidbh bayazidbh commented May 17, 2021

This is very helpful. Always nice to find the footsteps of people who have experimented with wine because THAT is always arse to experiment with on your own. Is there a solution for OCR-based translation like https://github.com/leminhyen2/Sugoi-Japanese-Translator by the way? Some of what I'm interested in are PSP games I'll have to run on an emulator.

Also, I'm on Fedora and Manjaro, both of which has moved from PulsaAudio to PipeWire. Any difference or issue in that regards?

@eshrh

This comment has been minimized.

Copy link
Owner Author

@eshrh eshrh commented May 17, 2021

@bayazidbh

There is; I use this one for manga gazou, but it should work pretty well for PSP games as well. There exists an option to "repeat OCR" on that program, so you can set the scan rectangle to your emulator text window, and write some kind of script to repeat that hotkey at regular intervals. It will copy the OCR result into your clipboard, which means you can use any standard texthooker page+clipboard inserter+yomichan (see the link under #mining effectively). I used this setup for some time until i started using the ocr less frequently because i became able to guess readings right almost every time.

Honestly i've got no idea about pipewire. The relevant parts of the code are lines 232-246: the if statement gets the audio device, and the ffmpeg call right after records from that device. There has to be a way to modify those two parts to work with pipewire.

@bayazidbh

This comment has been minimized.

Copy link

@bayazidbh bayazidbh commented May 17, 2021

Thanks, I'm I'm going to try out ScreenTranslator as well now.

I've been getting some weird sha256sum errors from vcrun2005 though, and I think there's some winetricks issue with vcrun2012 as well.

@bayazidbh

This comment has been minimized.

Copy link

@bayazidbh bayazidbh commented Jun 13, 2021

I've been testing wine 6.10 with latest winetricks, is there a particular reason for dotnet452 and vcrun2015 over dotnet48 and vcrun2019? I know that VNs generally don't use the latest frameworks, but is there a prroblem with dotnet48 specifically? And I believe that vcrun2019 includes vcrun2015 as well (hence why it conflicts), so why not go all the way to vcrun2019?

@zarc1411

This comment has been minimized.

Copy link

@zarc1411 zarc1411 commented Jul 15, 2021

@bayazidbh did you get it working?

@eshrh

This comment has been minimized.

Copy link
Owner Author

@eshrh eshrh commented Jul 15, 2021

Sorry, i never saw this notification...

the list of winetricks components up there wasn't really scientifically determined(nor did i come up with it). I just use it, and it hasn't broken (yet) so i don't mess with it. It's kind of just a base; if you need anything extra or something doesn't work you should modify it. I can't imagine that leaving our 2005 and 2012 will break a lot of vns; you should be fine there.

@bayazidbh

This comment has been minimized.

Copy link

@bayazidbh bayazidbh commented Jul 21, 2021

@zarc1411

I don't see any issue so far, though I'm not entirely sure on normal wine any more as I've begun using the wine-tkg-staging-fsync build (from Chaotic AUR). winetricks allcodecs sometimes have some issue, but I think the most important one is wmp11?

And like @eshrh said, if something doesn't work, or you read something somewhere else, you can try it. I have an entire folder of wine prefixes, on top of using Lutris, Bottles, and CrossOver. This is a very good and comprehensive starting point, but as with Linux and Windows programs, it's "whatever works for you."

@Nutjob

This comment has been minimized.

Copy link

@Nutjob Nutjob commented Jul 29, 2021

@eshrh

All the images in the guide are broken, also the file to the windows fonts is gone...

@eshrh

This comment has been minimized.

Copy link
Owner Author

@eshrh eshrh commented Aug 4, 2021

@Nutjob

The previous guide was pretty much exactly the same as the original guide that this was forked from, the "mining effectively" section was essentially the only new thing.

Since i started messing with vn's, i've come to realize that the whole lutris/cdemu thing is quite rarely necessary. I've rewritten the guide to more closely match my actual setup these days. In my opinion it's only very useful to people who aren't super comfortable with the command line and dealing with wine and wineprefixes(i'll admit, it gets nasty way too often)

As for the windows fonts, i don't believe they're necessary (i never installed them at least). Just make sure you have some good jp font that you like. In any case, the font file just moved, they're permalinked here if you ever need them.

@bayazidbh

This comment has been minimized.

Copy link

@bayazidbh bayazidbh commented Aug 4, 2021

Tested gamescope recently. I think it's a good solution for someone who wanted to be able to Maximize older titles that can't be Maximized and/or titles that have problems with fullscreen-ing.

Something like this should work: gamescope -- LC_ALL=ja_JP.UTF-8 TZ=Asia/Tokyo WINEPREFIX="/path/to/wine/pfx" WINEARCH=win32 LANG=ja_JP.UTF-8 wine ./Game.exe and if you have problems with window controls, just use Alt+Space (on GNOME at least).

You can then just make a new MIME file on ~/.local/share/applications or /usr/share/applications to have it be available from right click menu.

And I haven't tested it, but I wonder how FSR will work with older games. It's still on Lutris Beta for now, at least for the Lutris manager but I think it's already applied to wine-lutris 6.14 just like with proton-6.14-GE, but I'll definitely test it when it's out on stable. FSR + gamescope might be the a good upscaling option for Linux IF it works.

@Nutjob

This comment has been minimized.

Copy link

@Nutjob Nutjob commented Aug 4, 2021

@eshrh

Thank you for explaining and linking the fonts !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment