Sunday, August 25, 2019

Adventures in Linux Gaming

Last month I wrote about Playnite and GOG Galaxy 2.0. What I forgot to mention is that, for me personally, the major downside of each is the lack of Linux support.

I've been using Windows 7 for a long time. I didn't like the look of Windows 8 when it came out, and never saw the point in switching. Having used Windows 10 at work, I definitely have no interest in using it on my home PC, regardless of all the spying it supposedly does. I just don't enjoy using it. I suppose I don't particularly enjoy using Windows 7 either; I've had my share of problems with it. It just happens to be the best version of Windows which is still officially supported. Unfortunately, with that support ending at the start of next year, I would be forced to "upgrade" to a worse version of Windows if I want to continue to get security updates.

Do I really need security updates? I don't know. Is Windows 10 really worse or am I just biased? I guess it's a little of both. Ultimately, though, it probably doesn't matter. I've been somewhat unhappy with Windows in general, and... well, Linux is free.

Switching to Linux, and Why You Should, Maybe


Switching to Linux is seen by some as a daunting task, and perhaps there's good reason for those with no experience with Linux to be just a bit intimidated. To those terrified Linux beginners, I would recommend a user-friendly distribution like Linux Mint. That's what I'm using, despite several years of experience with Linux as a software engineer. It's just incredibly convenient. The Cinnamon desktop environment is fairly Windows-like, and Linux Mint comes with nearly all the features you need in order to avoid ever touching the command line if you don't want to. The installer is also very easy to use. Some casual PC users might not know what all of the options mean, but for those users, I think the defaults are probably fine.

Of course, no matter how automated the installer and how fully-featured the desktop environment, every Linux user will inevitably run into some kind of problem. The very same is true on Windows; the difference is that, when you search the internet for a solution to a problem on Windows, you'll almost certainly find a solution posted by someone who uses the same version of Windows. There are many Linux distributions, though; if you're not using one of the popular ones, you might find solutions which aren't quite what you need, or you might not even find any reliable documentation of the exact problem you're experiencing.

When I turn to the internet for help with installing something or fixing some error on Linux, the solutions I find are usually tailored to Ubuntu, which is fine because Linux Mint is based on Ubuntu, but it's not always the case. Sometimes the answers I find are all about Debian or Fedora. Sometimes it doesn't matter. Other times it does. I'm not saying that troubleshooting on Linux is a nightmare. These days, it really isn't. However, the fact that there isn't just one Linux comes with some inherent problems, such as this one, and troubleshooting does require a bit more patience.

But the fact that there are so many distributions means that, if you hit a roadblock and absolutely nothing works, you could always just try a different distribution.

How I Ended Up with Linux Mint


When I first decided to install Linux on my home computer, I tried Ubuntu. The installation process was mostly easy. I had some difficulty setting up dual-boot with Windows 7, but it wasn't Ubuntu's fault. It was because, while attempting to install Ubuntu from a USB stick, and I had inadvertently booted to my USB stick in UEFI mode while my Windows installation was using legacy BIOS. If you don't know what that means, don't feel bad; neither did I.

The short version of this story is that, when I booted my USB stick in legacy BIOS mode, the installation and dual-boot set-up went smoothly. However, I found Ubuntu's default desktop environment difficult to customize and annoying to use in general. Even after a bit of research, I couldn't figure out if my problems were the result of bugs or just obtuse design. Ultimately, for this reason and others, I decided that Ubuntu just wasn't for me.

That's when I tried installing Debian. The installation process seemed to work perfectly. Then I tried to boot to Debian, and nothing happened. I got a black screen. I did some research but there was really no way for me to try any of the solutions proposed to others who had similar problems, because I didn't even have a working terminal. I couldn't enter any commands. I assume that it was a video driver issue, and I could have attempted to fix it, but I decided that it wasn't worth my time. I had heard good things about Linux Mint, and I hadn't tried it yet, so I dropped Debian like a hot turd and started downloading Linux Mint.

That turned out to be the right decision; Linux Mint was easy to install, it booted up just fine, and to this day I've had no significant problems with it... except when trying to run games that were never meant to run on Linux.

Gaming On Linux


It always takes me a while to get to the point.

Linux Mint is great as a general-use desktop operating system. It comes with Firefox, LibreOffice, a media player, etc. But how is it for playing video games? Well, I'd say it's just as good for games as any other Linux distribution, and gaming on Linux today is better than ever, thanks in part to Steam.

Steam Play and Proton


A Linux version of the Steam client has been available since 2013, allowing Steam users to play any games which happened to have official Linux versions. It was only about a year ago, however, that Steam rolled out an update to the cross-platform Steam Play feature, allowing Windows games to be installed using the Linux client and providing a Wine-based compatibility tool called Proton which allows many of those games to run on Linux with very little effort from the user.

Installing Steam on Linux Mint doesn't require any command line usage, nor does it even require a web browser. You just open the Software Manager, search for Steam, select the first result, and click the install button. Meanwhile, enabling Steam Play for all games is just a matter of checking a box in the Steam settings menu. If I remember correctly, this option is disabled by default, and initially Steam Play is enabled only for officially supported games, which is no surprise; it's sensible for anything that isn't guaranteed to work to be disabled by default. But the option isn't hard to find, and often no effort is required to get games to work even if they're not officially supported.

ProtonDB tracks how well Steam games work with Proton by aggregating user-submitted reports. Games without native Linux support are rated on a scale of Borked (meaning it won't run at all) to Platinum (meaning it runs perfectly out-of-the-box), with three ratings (Bronze, Silver, and Gold) in between. I'll let the statistics on ProtonDB speak for themselves, but they appear to indicate that the majority of games are playable.

My own personal experience with running Steam games on Linux has been better than expected. Of course, I've been using ProtonDB as a resource since the beginning, and I haven't bothered to install games which are definitively rated Borked. In general, I've gravitated more toward the games with higher ratings. Therefore, I can't claim that the games I've tried playing on Linux via Proton, of which there are about a dozen, are a random sample. However, even when I've tried to play games rated Bronze or Silver, I've been mostly successful, as I've found solutions in ProtonDB's comments to some of the minor problems I've encountered. And the only game rated Borked which I've really gotten the urge to play since installing Linux Mint is L.A. Noire, and for such games, I still have Windows 7 installed on my other hard drive.

I won't describe my experience with every game in detail, but the first Windows-only game I played on Linux Mint was Max Payne, and... frankly, it just worked. It worked perfectly, actually. The only difficulty I had was not with the game itself but rather with the unofficial widescreen patch, and it was only a momentary setback. The comments on ProtonDB quickly set me straight; I added WINEDLLOVERRIDES="d3d8=n,b" %command% to the game's launch options in Steam and even the widescreen patch worked perfectly.

Similarly, Max Payne 2 works perfectly in Linux, and getting the unofficial widescreen patch to work simply requires adding WINEDLLOVERRIDES="d3d9=n,b" %command% to the game's launch options. Playing Max Payne 3 was a bit more difficult; initially, it wouldn't launch. Following the advice of comments on ProtonDB, I added PROTON_USE_WINED3D11=1 %command% to the game's launch options, and it worked, but with some bugs. The minor issues with Max Payne 3 which remain can probably be fixed, perhaps by trying one of the other Proton versions offered by Steam or by further modifying the runtime configuration, but I had only installed it for testing purposes anyway. I was really more interested in playing the first two games in the series, so I didn't spend much time troubleshooting the third.

Non-Steam Games and Wine


Despite needing the occasional web search to find the correct configuration with which to run a certain game, Steam Play with Proton is actually so convenient it's easier than ever for me to ignore the games I bought from other online stores such as GOG. While there are games on GOG with official Linux support, the GOG Galaxy client does not have a Linux version (despite a lot of GOG users wanting one). Downloading games directly from the GOG web site isn't hard, but clients such as Steam and Galaxy do offer a lot of convenience.

Furthermore, although I could probably use Wine or other tools to play many of the Windows-only games from my GOG account on Linux, it would require more effort than running Windows games via Steam, which very often just works automatically. I did install Wine with the intention of playing non-Steam Windows games, but I just haven't used it yet, because Proton — when it works, which it usually does — is just so effortless. If I'm trying to decide what to play, and I've narrowed down my choices to one GOG game and one Steam game, I'm likely to pick whichever is easiest to run on Linux, and that's going to be the Steam game nine times out of ten.

That might change a bit when I get around to trying Lutris, a game client not associated with any particular store, which also claims to reduce installation of many Windows games on Linux to a zero-effort, one click process. It looks like a promising solution for playing some of my GOG games on Linux. For what it's worth, though, installing Lutris is one extra step. I'm going to have to be a jerk and say that Steam still makes it easier by having Proton integration built in to its own client. So many of my games were already working on Linux as soon as I installed Steam that I haven't taken the time to use much of anything else.

So I don't have much to say about running Windows games with Wine, via Lutris or otherwise. I plan on experimenting with it eventually, and once I've done so, I'll probably write a sequel to this post. Right now, though, I'm looking at a huge Steam library and a high success rate with using Proton with very little tweaking, so I probably won't be straying away from Steam very often, except for the sake of experimentation. When I just want to play a game, Proton is often the best way to make it happen.

The Classics


There is one category of games for which I've already strayed outside the Steam bubble: Old-school shooters. I've got to have them.

The Steam versions of The Ultimate DOOM, DOOM II: Hell on Earth, Final DOOM, Heretic, HeXen: Beyond Heretic, and HeXen: Deathkings of the Dark Citadel all run in Proton. They were all, in fact, officially tested by Valve with specific versions of Proton, so that they show up in my Steam library with labels like "Proton [version number] selected by Valve testing" and will run with the indicated Proton version instead of the default I selected in the global Steam settings.

I find this rather amusing because the Steam versions of these games run through DOSBox which, if I'm not mistaken, has a Linux version. However, I'm not suprised that the game's publisher, id Software, hasn't made the effort to repackage these old games with the Linux version of DOSBox for an official Linux release on Steam, especially given that most users who are computer-savvy enough to use Linux will just take the game files downloaded via Steam and run them in a source port instead of DOSBox anyway.

That's what I did with all of these games, immediately after installing them. There's a Linux version of GZDoom, which isn't a suitable source port for anyone who wants the games to run exactly as they did in the '90s, but it's good enough for me. Like any sane person, I did disable major gameplay options which were not in the original games (such as vertical freelook in the DOOM games, jumping in DOOM and Heretic, and ridiculous stuff like crouching), but the graphical upgrades don't bother me.

Getting GZDoom to launch with the correct options for each game was a bit of a hassle, but no more than it was on Windows. The only real problem is that GZDoom, on my system, encounters some kind of error when I close it, which might have something to do with the fact that it doesn't seem to save changes to the gzdoom.ini file unless I enter the writeini console command while running GZDoom. Knowing the workaround, I'm not really bothered by it.

Satisfied with the DOOM and Heretic/HeXen games, I moved on to Wolfenstein 3D and its expansion Spear of Destiny, and installed the source port ECWolf. To my surprise, it seems to work perfectly despite being, in my estimation, less widely used than GZDoom. So then I moved on to the Marathon trilogy, available as freeware since 2005, and attempted to install the source port, Aleph One. That, unfortunately, could have gone more smoothly.

Not Everything is User-Friendly


The official Aleph One web site has some pretty basic instructions for installing the Linux version: Unpack the .tar.bz2 file and, in the unpacked directory, run ./configure && make && make install. Unpacking the file was easy, but I started having problems as soon as I ran the configure command. I won't bother going into all of the messy details, but I went through several iterations of trying the installation, which would fail due to missing dependencies, and then installing those dependencies.

Synaptic Package Manager, included in Linux Mint, makes finding and installing missing packages about as easy as it can be; doing it on the command line using apt or apt-get isn't very hard either. But I had never needed to hunt down dependencies like this. When installing software through Linux Mint's Software Manager, or even when installing a program using apt install, all dependencies are installed automatically (which I now regard as a miracle). Installing software manually, however, isn't quite so easy. Perhaps I was to blame for not knowing what all of the dependencies were beforehand, but it was getting frustrating.

When I finally got Aleph One installed, I was able to launch Marathon, but it printed some errors to the screen and there was no HUD. Searching the internet for a solution, it turned out I was still missing some "optional" dependencies, and installing those made things worse; my next attempt at installing Aleph One failed outright, seemingly due to a dependency which I had already installed.

That's when a comment on the Aleph One GitHub repository, posted only eight minutes before I saw it, clued me in to the fact that I had gone down the wrong rabbit hole. The easier and more reliable way to install Aleph One is to clone the Git repo, go into the root level folder, and run ./autogen.sh followed by make and make install. I had to install git (which I've used extensively but not at home) and I was still missing a couple of dependencies required by the autogen.sh script, but it told me exactly what the dependencies were, so installing them was just a matter of running the correct sudo apt install command.

So I've got Marathon and its sequels working on Linux now, but installing Aleph One took more than an hour after all was said and done. I've learned a lot, though, and ultimately the solution to every problem was revealed with a simple internet search. This story could scare people away from trying to play games on Linux, but it's important to keep in mind that I had this much trouble only because I was trying to play a 25-year-old game. Doing that on Windows isn't always easy either.

I still haven't installed the classic Quake games, and I think those are next. I can only hope installing their source ports will be a bit easier.

Conclusion


I guess the moral of this story is that installing and running games on Linux can take a bit of patience, but I only came close to running out of patience when I tried to do things that only an old-school game enthusiast determined to use Linux at all costs would ever try to do. With Steam, many of the games that work on Linux will "just work" and, for non-Steam games, I'm told that Wine isn't very hard to use either. However, I do know just enough about Wine to know that it requires some effort. The average consumer expects things to work with a single mouse click. They want one-click install and one-click launch of every game.

For games with native Linux support, you can have that. For the rest, Steam comes pretty close to providing that level of convenience. Until other stores like GOG implement some kind of compatibility layer like Proton into their own clients, Steam will dominate Linux gaming for the same reason that Windows dominates gaming in general: It's just easier.