Jump to content

Guide: How to run Touhou under Linux


Pepi

Recommended Posts

Welcome to a new topic!

kutaka-pc.gif.bee06983e83018cb419283b988df21a2.gif

I've heard you want to become a supa hacka... That you want to reject your privileges of touching grass and embrace headaches while trying to get everything working, just to play danmaku games...

Are you ready to embrace the Linux inside you? BECOME THE PENGUIN!!! ACT LIKE A PENGUIN!!! SPREAD THE PENGUIN!!!

nitori-touhou-nitori.gif.1ce654faad2844da5460b87233f32e6a.gif

Our deepest apologies for the interruption. A supa hacka hacked shitposting into the mind of Pepi, but unfortunately he is now cured.
On this guide, we will see all the tricks to get Touhou and other helpful programs running on Linux (Touhou Patch Center and Touhou Practice). This will also include Program and Linux Distribution recommendations for the optimal experience.
We will later include guides on how to run the PC98 games and Lost Word on Linux, tell me if you prefer those guides as separate topics or as replays in the comments.
Let's get to the point.
 

⚠️Technical Terms Warning⚠️
I'm going to be using some technical terms, they will be explained at the bottom of the Topic.
Also keep in mind that if you deviate too much from the steps presented here, things may not work, so do them at your own risk.

 

1) Pre-Touhou Linux Distro and Program Recommendations:

Touhou works pretty well on most Linux Distributions. I'm just being nitpicky to guarantee you a good experience without troubles. And it's important that we remember a golden rule of computers, it may work on my machine, but it can break on yours.
All Steam games have a Linux compatibility page that clues you in on tips and tricks to get everything running correctly, we aren't going to use it, but it can be helpful for other games.
https://www.protondb.com/

If you are utilizing the GNOME Desktop, please avoid playing the game in fullscren or in the Wayland session. GNOME currently lacks some technical things related to tearing that makes playing Touhou very unpleasant.

I heavily recommend that you utilize a Linux Distribution that ships the KDE Desktop, as it's what the Steam Deck uses, and it's the fastest to introduce Gaming benefits (along other benefits). You can find KDE distributions on https://kde.org/distributions/
My personal recommendation is that you use Nobara or Kubuntu, these two are the most reliable Linux KDE Distributions out there.

Before we install the software needed for this to work, you should know what a Compositor is.
A Compositor is an extra layer inside the Window Manager (what manages windows, lol) that is tasked with showing pretty animations and some things like 3D effects, like the old Compiz effects (search that on youtube, it looks fun).
 

If your Linux Desktop supports it, disable Composition for full screen programs as it will increase responsiveness. Im certain that KDE and most Desktops support disabling it. Be aware that GNOME doesn't provide an easy way to disable it.
The only downside is that it will increase the chance of tearing happening, if that's your case, please check the Troubleshooting Step at the end of the Topic.

 

Now, for required software, we are going to need the Flatpak Package Manager, the Bottles program and Flatseal.
You can install Flatpaks by following the guide at: https://flathub.org/es/setup
Once that's done, install Bottles by following the instructions at: https://flathub.org/es/apps/com.usebottles.bottles by clicking on the big blue "Install" button.
After that, install Flatseal by following the instructions at: https://flathub.org/es/apps/com.github.tchx84.Flatseal

And of course, you need a Touhou game. If you are already on this website, you know where to find them, maybe in the big "DOWNLOADS" button? Then always download (if available) the versions that already come with thcrap installed. DON'T DOWNLOAD IF IT SAYS UNPATCHED.

2) Managing Flatpaks:

Linux's distributions always ship with something called a "Package Manager". They are tools that allow you to install, update, remove and more things with Software. They are usually limited to different distributions, for example Kubuntu uses APT and Nobara DNF.
We are going to use Flatpak, a universal package manager that you can install on ANY distribution (avoiding fragmentation troubles that are common in Linux).
If you want to utilize Bottles to its fullest potential (including increased ease of use and the ability to run thcrap Patches and thprac) we need to disable Sandboxing. If you want a more limited, but more secure experience (especially when running Windows programs), ignore this section.

Flatpaks have the characteristic of being Sandboxed (it means they are isolated from the rest of the system), these are the steps to disable Sandboxing:

Open Flatseal and you will see something like this:

Screenshot_20230913_201826.thumb.png.2226f536139a0f391e73382c3ca95252.png

On the left you have your flatpak programs and in the center/right the list of permissions that flatpaks have. You will scroll down the list until you find the Filesystem section, then find the All user files section and click enable.
This disables sandboxing.

 

3) Installing and Running Touhou:

And then, Marisa said "it's touhouing time" and she touhoued all over the place, resolving the incident. I'm not sorry.

Create a folder wherever you want where you will place all of your Touhou games. What i do in my PC is to make a "Games" folder and drop all the games downloaded with thcrap in there. This is important if you want to download custom thcrap patches, and if you don't, keep them organized anyway, love yourself a bit and don't keep everything dropped on the desktop.

Open Bottles. It will first give you a welcome screen, and it's probably going to download some files (I don't remember, and I'm too lazy to check). Once you can move around in the program, click the + button at the top left and it will ask you to make a new Bottle.

Click the "Gaming" button and name the Bottle Touhou. Then it will download some stuff (it takes a while).

Once it's created, enter the bottle and test if the touhou game works correctly by clicking on the big "Run Executable" button and navigating until you find the game's executable.

If it worked, congratulations! You can now prolong your suffering with the danmaku!
If it didn't, or you have any kind of small issue, check the Troubleshooting step. Don't settle for an experience with even the smallest issue, in this house we want it flawless!

I recommend that you add the game to the Programs Shortcut in Bottles, by clicking the + Add Shortcuts button and then selecting the game. You can also launch the game by right-clicking in the executable and selecting Bottles as the program to run the games. If you want to create a shortcut, use the Linux version, called Symbolic Link by following the instructions here: https://linuxhint.com/create_symbolic_link_ubuntu/

 

4) Using Touhou Patch Center (thcrap):

Thcrap works as a tool to make loadable modifications to your Touhou games. Unfortunately, I was unable to run Thcrap's modifications directly (the patched english executable bundled with the downloads works) and we have to use some terminal commands to make them run.

But first, launch the thcrap executable found inside your game's folder (if it gives an error, try the other executable) and create your patch. It's important that you give the file a name that's easy to remember and write, like "th06patch1"

Remember that we placed all the Touhou games on the same folder? To make running these patches easy, create a text file where you are going to store all the terminal text needed to run the patches.
We need to copy the file path of the folder where thcrap stores all the patch files, it's a folder named "thcrap". The file path has to look something close to this:

/home/YOUR-LINUX-USERMANE/Games/Touhou 6  - The Embodiment of Scarlet Devil/thcrap

In the text file you made, paste that and place a "cd" before the file path, like this: cd /home/YOUR-LINUX-USERMANE/Games/Touhou 6  - The Embodiment of Scarlet Devil/thcrap

After that, place the following thing in the top of your text file: thcrap_loader.exe PATCH-NAME.js thXX
That command is what we are going to use to execute the game, the "patch-name" is the name of the patch of choice you want to run and the "thXX" is the identification to what game the patch belongs, for example Touhou 6 is "th06"
You can also get more specific and write the finished command close to the game location/cd command and not the template at the top, for example: "thcrap_loader.exe th06patch1.js th06"
The idea of the template is to make it easier if you create lots of patches constantly to avoid the hassle of writing them down in the text file.

This is a screenshot of my text file:

Screenshot_20230913_215109.png.a3491bc0d881bbec4a4e8e0bf743144b.png

Save the text file and leave it somewhere handy. After that, it's time to test if this worked.

Open Bottles and the Touhou Bottle, then scroll down until you find the Tools section and open the Command Line option. Note that you need to have Bottles' Sandboxing disabled to make the following work.

Other thing, Bottles' command line doesn't support Ctrl + V, use right click and select paste.
Once in the command line, paste the game location/cd line and press enter. What this does is enter the folder where thcrap is located, it's the text command to double-clicking in a folder to enter it.
After that, paste or finish writing the thcrap_loader line and press enter. If everything worked, the game should run with the selected patches.
There's a chance that any crash is due to the patches and not the process itself, if you have any issues check the instructions again, as this is very logical and the errors were likely your fault.

5) Running Touhou Practice (thprac):

Thprac is a tool that makes practicing Touhou games easier. It's a lifesaver, and it replaces Touhou's mostly lackluster practice mode.
You find it in-game after entering the respective game's practice mode.
To download thprac, go to https://github.com/touhouworldcup/thprac and search for the releases button and download the first result (at the bottom of the first result, select the .exe file).
 

My advice is that you place thcrap's executable in the folder where all of your games are stored and manually add the games using thprac's interface. In the download link there is a tutorial video of how to use it.
 

Aaand... Done! Thprac works almost flawlessly under Linux, the only troubles is that sometimes when you update it, it looses the file locations or the interface gets all laggy after you close a game (just close and open thcrap again).
It's also impossible to run Touhou6 directly from thprac, altough it's likely that if you run the game first and then launch thprac it will work (i didn't try it). Touhou6 is a pretty old game and it also has issues on Windows, be patient with it.

 

6) Troubleshooting Help:

I'm going to place a common question, and its answer, like a common Q&A part of a website.

My game makes my screen break!

You are likely suffering from Screen Tearing, it's something that happens when the game wants to draw frames quicker than what your monitor supports. The effect is a graphical bug where horizontal lines cut the image and it makes it look ugly.
This only happens if you are running the game under the Legacy X11 Graphics (worry unless you use KDE or a Wayland Window Manager). Currently it affects the mayority of desktop users.
The solution is to enable the "tear-free" mode. Note that if you use an NVIDIA GPU you have to enable the feature inside their graphics menu, i never used NVIDIA so i can't help you here, search for "linux nvidia screen tearing" or something like that and follow the instructions.

If you are using AMD/Intel, follow the instructions in this website https://linuxreviews.org/HOWTO_fix_screen_tearing . Please be careful, any error can make your system boot without graphics, read attentively.
This is the setting i use to disable tearing, exclusively for recent AMD GPUs:
sudo nano /etc/X11/xorg.conf.d/20-amdgpu.conf

(inside the text file, paste this using right click paste)

Section "Device"
   Identifier  "AMD Graphics"
   Driver      "amdgpu"
   Option      "TearFree"  "true"
EndSection

 

My Touhou sounds wrong!!!

This happens when you are using an incorrect version of WINE, please read the step below.

 

Thcrap doesn't download anything!

Our second WINE (what Linux uses to run Windows things) problem in the night!
The problem can manifest itself as either errors during downloads of patches running Thcrap to modify your game, or when running the bundled executable, as it auto updates itself.
It sometimes happens that WINE has some broken things, the solution is to change the WINE version. Luckily, Bottles provides an easy way to switch WINE versions.

First, go to Bottle's general settings, look up the 3 dots in the top right and click Preferences, then click on Runners and search for the option that says Proton-GE, click it and select the first option in the drop-down menu and hit the Floppy/Save Button

Once it downloads the version, go inside the Touhou Bottle, go to the Settings option and click the Runner setting. Then, a drop-down menu with all the available WINE versions will appear, select the Proton-GE and once it finishes try to launch Thcrap again. If it fails, repeat the steps but with other wine versions that aren't Proton-GE.

 

My game's position looks shifted!

This happens if you are on The X11 Legacy Graphics, it's impossible to fix. Well, you can switch to Wayland Graphics, but it's still not widely adopted, only GNOME, KDE and Window Managers like Sway fully support it at this time.
Let's say that Seija infected your game and played with it's possition. You can always run the game in Windowed Mode. Eitherway, this shouldn't be problematic, because Touhou already has unused space in it's UI and it doesn't affect gameplay.

 

Touhou 14 Crashes!

Seija likes to troll you... There's currently a bug with thcrap that makes it crash the game if you run thcrap under X11. The solution is to annoy thcrap devs on their discord to make them fix it (don't be rude!), or run the game unpatched.
Running the game with Wayland Graphics also fixes the issue.

 

Touhou 14 doesn't save my controller scheme!

Read the question above, Seija really hates Linux... The solution is to run the game unpatched.

 

Thprac doesn't run Touhou 6!

It's unfixable. Read step 5) for more information. Maybe politely annoy the devs of thprac???

 

My game doesn't connect to the internet!

Follow the steps on the "Thcrap doesn't download anything!" section.

 

 

7) Technical Terms:

Yes this is all over the place and not in alphabetic order, im too tired right now. I will format it better later if possible, if not im sorry :)
Im not getting paid so it's fair.

Wayland and X11:
Wayland is a graphical api that makes sure that the programs and desktop inside your Linux can communicate effectively to your graphics card. It's the modern version of the older X11.

KDE:
A community of people that decided that making software following certain guidelines was Kool. Yes they like to write everything with a K, like Konsole or Kate. They also make a desktop enviorment jam packed of features.

Desktop Enviorment:
It's the interface you see when you boot up your computer. Windows has one, Mac has one, Android has one, you get it.

WINE:
It's a translation software that translates the differences in functioning between WIndows and Linux. Think of it as someone translating English to Spanish.

GNOME:
Another desktop enviorment that was created because they didn't like how Kool KDE is. Joking, it was because at the time there was some drama and im too tired to explain it. They like to not listen to their users and they give fancy excuses.

Linux Distribution:
When someone decides to make a version of Linux. The general term is Linux Distro, these are things like Ubuntu, Debian, Arch, AmogOS, Hanna Montannah Linux, Ubuntu Satanic Edition (yes, those existed).

Package Manager & Flatpak:
Already explained in the post. Read please!

Steam Deck:
Amazing handheld console that can also work as a personal computer thanks to Linux!

Linux:
A project from Linus Torvalds to create a kernel (what communicates between your hardware, like your mouse, and the software inside the PC). It took off and it's used in lots of things.
You will often see a shitpost that says "it's not Linux, but GNU/Linux", yeah the GNU guys where involved in making Linux big but that's all, ignore it.

Touhou:
Why are you here? Game with epileptic lasers with badly drawn, but eitherway cute girls made by a Japanese Human who has addiction problems with beer.
We like that in here.

Window Manager:
Something people who dislike to touch grass use. It's a more minimal approach to desktop enviorments, it usually also auto resizes windows to use all available screen real state.
It's useful for people who really enjoy Linux's freedom aspect. Altough you will get better results with KDE or GNOME, avoid them if you want to keep your mental sanity.

 

Did your Computer Explode???

sumireko-usami-touhou.jpg.d3ac0782e945aa13e8b49c5211124aa3.jpg

Jokes aside, i hope this was helpful. We will see each other again shortly, but with guides in how to run PC98 games or Lost Word. Remember to comment how you want it to be done, either via answers in here or as sepparate Topics.
If there's any improvement to this Topic, please comment it down below or via private messages (either from Moriya directly, or via my discord that's available on my profile page). I will post any new discoveries as comments (idk if you can edit posts here, never tried it, oh well).

One more question, would you be interested in a "How to Linux 101" Topic? I can write a guide in how to switch if someone's interested, let me know!

 

 

Edited by Pepi
Forgot something in troubleshooting section. And grammar/formating. Added more things suggested in the comments.
  • Like 1
Link to comment
Share on other sites

Very nice guide.

I would just add some more troubleshooting points. On all machines I played Touhou on, using vanilla wine and proton will make the game's SFX muffled due to bad resampling. Using Lutris's builds of wine and proton-ge fixes this. Maybe bottles's builds also have it patched.

I would also mention what a compositor is and how to disable it, because ideally we don't want vsync or any additional input delay on the game. I never played a game on Wayland, I don't know how well you can take care of this, but on Xorg I know you can disable the compositor in most desktops.

  • Up 1
Link to comment
Share on other sites

21 hours ago, nukinom said:

There's a bunch of stuff in here that one should already know the moment he or she decides to run Linux... But otherwise, great explanation. Never used Bottles though, I use Lutris instead.

The reason i didn't make this guide with Lutris was because i couldn't find any way to open a wine terminal inside it. Aside thcrap, it should work as well.
Other reason is that Bottles allows things like exporting a Bottle (if you have other machine with Bottles, you load the Bottle file produced, and it stores all the configurations), it's more ambitious than Lutris.

Link to comment
Share on other sites

11 hours ago, Space Banana said:

Very nice guide.

I would just add some more troubleshooting points. On all machines I played Touhou on, using vanilla wine and proton will make the game's SFX muffled due to bad resampling. Using Lutris's builds of wine and proton-ge fixes this. Maybe bottles's builds also have it patched.

I would also mention what a compositor is and how to disable it, because ideally we don't want vsync or any additional input delay on the game. I never played a game on Wayland, I don't know how well you can take care of this, but on Xorg I know you can disable the compositor in most desktops.

I forgot compostiors were a thing, I never noticed any extra input delay from it.
On KDE it allows you to disable it, but GNOME like always just doesn't.

I'm adding the SFX part and compositor guide, thanks!

Link to comment
Share on other sites

  • 3 months later...
  • 3 weeks later...
  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.