Skip to content

Instantly share code, notes, and snippets.

@eshrh
Last active September 27, 2024 03:53
Show Gist options
  • Save eshrh/5bbf4deab58fefdab9eacf77b450efc0 to your computer and use it in GitHub Desktop.
Save eshrh/5bbf4deab58fefdab9eacf77b450efc0 to your computer and use it in GitHub Desktop.
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
Copy link

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
Copy link

@bayazidbh did you get it working?

@eshrh
Copy link
Author

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
Copy link

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
Copy link

Nutjob commented Jul 29, 2021

@eshrh

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

@eshrh
Copy link
Author

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
Copy link

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
Copy link

Nutjob commented Aug 4, 2021

@eshrh

Thank you for explaining and linking the fonts !

@bayazidbh
Copy link

@eshrh were you the one that wrote the guide on the learnjapanese site btw?

I just want to add a note regarding Yuzusoft games (since they're pretty popular) that some of the codecs installed seems to conflict with Yuzusoft's, and I found that while you can run their games pretty smoothly with the new versions of wine it won't play the movies either.

After looking at protondb and my own experiment, it seems that to play their game smoothly and play the movies, it's best to use wine 4.x (tried Proton 4.11 and Lutris 4.21) with only winetricks (or protontricks) wmp11.

Not sure what is up with the newer wine versions, and I've tried the ffdshow and lavfilter prefixes with wine. It's not really a problem if you don't care about the movies, though.

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