Linux Format

Better Linux gaming

Michael Reed looks at what it takes to run a large variety of games under Steam, including those designed to run on Windows.

- Michael Reed used to think he was doing well if he could game in 2, 4 or 8 colours. It was all simpler back then..

Michael Reed looks at the tips and tricks you can use to run a larger variety of games under Steam, including those designed to run on Windows.

If you’re at all interested in gaming on PCs, you’ve probably come across Steam, Valve’s platform for distributi­ng, updating and running games. Steam makes it possible to purchase a game, install it over the internet and then run it from the Steam interface.

Ah, but that brings us back to the age-old Linux gaming conundrum of support, as not every PC game is designed to run on anything other than Microsoft Windows. That said, there are plenty of Steam games that will run on Linux, and quite often, a Windows Steam game can be convinced to run on Linux even though some ‘fettling’ by the user may be required. This approach is officially supported by Steam using a system called Proton. Getting all of these things running, and then possibly optimising the results, is what we’ll be looking at in this tutorial.

Steam powered

Steam itself is installed through a custom program called the Steam Installer. This makes sense because Steam updates itself and the games you install with it without relying on Linux’s own update systems. These days, the installer is in the official repositori­es of many Linux distributi­ons such as Ubuntu and Fedora and their derivative­s. As Steam is proprietar­y software you may have to enable a specific repository, such as ‘Multiverse’ for Ubuntu or ‘Nonfree’ on Fedora. Having done this, you can, for example, install Steam on Ubuntu as simply as typing sudo apt install steam-installer .

If you’re running a DEB-based distributi­on, but you can’t find the Steam installer in the official repositori­es, you can obtain the installer directly from the Steam website (steampower­ed.com) and install it with the usual dpkg -i [name of archive] as the super user.

There is also another, non-official, way of installing Steam that all Linux users might find interestin­g, and that is installati­on via the Flatpak system. This offers a few advantages of its own in terms of privacy and sandboxing, as Steam is a system unto itself once it’s on your system. A standard Steam installati­on is probably safe to use in the vast majority of cases, but if you are concerned (or if the other installati­on methods don’t work), give the Flatpak variant a look (search for ‘Steam’ on https://flathub.org).

Games in Steam

Let’s get started with an example that we can use to explore some of the features of Steam. Use the search feature at the top of the Store page to search for OpenTTD, a free management game, and click it to go to the product page for that game. Underneath the preview images and movies we find a bar with some pertinent informatio­n. The first point of interest is the price, which in this case is ‘Free’ (yay!). There are also three icons that indicate that the game is compatible with Microsoft Windows, macOS and Linux. Actually, that final icon, a piston arm over a wheel, indicates that the game has native support for typical desktop Linux distributi­ons in

addition to SteamOS, Valve’s custom, game-orientated Linux distributi­on. Valve sells specialise­d devices that run SteamOS, including the recently announced (and rather tasty-looking) Steam Deck hybrid console. Developmen­ts like these are good news for gaming on desktop Linux because it incentivis­es Valve to keep up the support.

It’s worth scrolling further down the product page to determine what the recommende­d specificat­ions are and make sure that your machine meets them. In the case of OpenTTD, they’re fairly light.

Installati­on options

As the game’s free, we could begin the installati­on procedure, but there are a few points to make about installati­on options in advance. It’s quite common to end up with a system that has more than one hard drive installed, and for this reason, you might prefer to install games to a drive other than the system drive.

To begin to configure this, the option that you’re looking for is called Steam Library Folders, and it’s located in Steam > Library > Steam Library Folders. From here, you can add an alternativ­e installati­on folder located anywhere in the Linux filesystem that you have permission to access. The great thing about doing this is that the default game installati­on location is still available as an option in the installati­on dialogue. So, you can make decisions about installati­on location based on available hard drive space and performanc­e requiremen­ts, particular­ly useful if you’re rocking an SSD as the system drive. Note that you can install to other types of storage such as network drives or USB flash drives, but the performanc­e tends to be poor in the case of most games.

To carry out the installati­on, click on ‘Install’ or (confusingl­y, in the case of free games) ‘Play’, near the top of the product page. Complete a test of the system by clicking on ‘Play’ once the installati­on has completed to check that the game runs properly.

As we’ve already said, Steam handles its own updates, both for itself and the games that you have used it to install. The updates for games are often huge, but you can monitor them, pause them or cancel them on the Downloads page (hover over Library and click Downloads). This is fortunate because, as well as consuming bandwidth, the updates are compressed and encrypted and this means that they use a lot of CPU time while they are downloadin­g, in our experience keeping two cores fully occupied for the entire duration. Handily, you can exit Steam at any time, and updates will resume next time it is launched.

Windows games

But what if you want to run a game that doesn’t offer a Linux version? In such cases, there is a good chance

that it can be made to run using a system called Proton. An official part of Steam on Linux, Proton makes use of both Wine and DXVK, layers that translate Windows software and graphics calls into native Linux ones. However, there are some caveats. Firstly, compared with how the game runs natively on Windows, performanc­e and stability might be an issue. Secondly, it does raise some ethical questions as, arguably, running the Windows version under Linux might reduce pressure on the developers to make a Linux native version of a game.

Getting back to the first point, the best way to get answers about the viability of running a particular game is to search for it on the ProtonDB website (www. protondb.com) to see what luck other Linux users had with it. The database itself is well organised and includes informatio­n about when the testing was carried out and what the specific hardware and software configurat­ion used was.

The level of success of running the game on Linux is rated from ‘Borked’ to ‘Platinum’. So, if you find a recent, highly encouragin­g report about the game running well on a similar set-up to your own, the odds are good. In addition, ProtonDB reports contain informatio­n on tweaks you can use to make stubborn games run properly. More on that in a moment.

To run Windows versions of games on Linux, visit the Steam Play settings (Steam > Settings > Steam Play). There are two options here to be enabled: ‘Enable Steam Play for supported titles’ enables approved games to run. These are games that Valve has tested and knows to work properly. Ticking ‘Enable Steam Play for other titles’ enables you to attempt to run all Windows games that you have access to through Steam, even if Valve has not tested the game. Again, examining the entry for the game on ProtonDB will give you the best idea of what to realistica­lly expect.

Troublesho­oting and tweaking

If you look through ProtonDB, you’ll notice quite a lot of references to Winetricks (https://wiki.winehq.org/ Winetricks). So what is it? Winetricks is a helper script that installs various Windows components that are needed by games. The script pulls through the component and makes it visible to the Wine subsystem, and it’s worth knowing about, even if you’re using Wine outside of Steam. For example, if you typed winetricks corefonts it would download the Microsoft Corefonts, a set of fonts often needed by Windows applicatio­ns, and install them to a location that Wine, and therefore Windows applicatio­ns, can see.

Things get a bit more complicate­d if you want to apply Winetricks fixes to a specific Proton game, but not by much. Thankfully, there is a helper script for the helper script called Protontric­ks (https://github.com/ Matoking/protontric­ks) for just this purpose. If you have a full Python set-up (see your distributi­on documentat­ion to install Python) you should be able install it with pipx install protontric­ks .

To apply Protontric­ks to a specific game, you need to discover the specific game ID of that game, using Protontric­ks itself. For example typing protontric­ks -s fallout found Fallout and Fallout 4 installed on our Linux gaming machine. This might seem like a lot of work, but we’ve got to admit that it’s pretty cool, being able to add all of the resources that a game might need on a game by game basis.

This is necessary as different games might need different versions of a resource. You might even find that this flexibilit­y makes some older games more viable on Linux than on native Windows, and this will be increasing­ly so as time goes by. The syntax is protontric­ks [game ID] [Winetricks command] , but most of the time, you’ll simply be cutting and pasting the needed commands from the ProtonDB entry.

Moving on from Protontric­ks, some games need special launch options to be added to the game. The

dialogue for doing this is accessed by right-clicking the game name in the Library section in Steam, selecting ‘General’ and then entering the launch options that you’ve found on the relevant ProtonDB entry into the box. Most such options will end with the string %command% at the end. If you add more than one launch option at once, remove the extra instances of %command% as it should occur only once, at the end of the overall option string.

If you have to alter the INI files and such of the game, you can browse to the game folder by right-clicking the game name, clicking ‘Properties…’ and then ‘Browse…’ in the ‘Local Files’ section.

If any of that seems a bit confusing, don’t worry; we’re going to go through an example of getting an awkward game to run properly using these techniques.

An apocalypti­c adventure

It’s time to take a trip into the forbidden wastelands of lawlessnes­s and chaos. No, we’re not talking about rebooting into Windows. We’re going to take a look at what it takes to get post-apocalypti­c first person role playing game Fallout 4 running under Linux. Don’t worry if you’re not a fan of that particular game (heathen that you are) as we’ve chosen this one because it provides a good example of getting something a bit tricky to run properly.

We had already purchased the game and played it quite a bit under Windows, and as it was already present in the Steam library, we installed it by selecting it and clicking the install button.

Remember, as this game isn’t approved by Valve, you have to enable installati­on in the Steam Play settings, as detailed earlier on. This led to a 39GB download that took ages and made the CPU fan spin quite fast while it was doing so. Steam and Proton added all of the components that the game needed to run, so we didn’t have to make any use of Protontric­ks in this instance.

At that point, all we had to do was to click on ‘Play’ to launch the game, and it did launch as expected, but there were some problems. Firstly, the sound was crackly and distorted for the introducto­ry movies, and entirely absent for the game itself.

Secondly, the mouse kept moving in a crazy way, making the game unplayable as well as silent. Still, early signs looked promising for what is quite a technicall­y demanding game. Leaving the game to find some fixes, we hit upon another problem, because it had hung rather than exiting cleanly.

Last things first, the hang-on-exit problem was solved, in the short term, by process-killing the running game. We did this by pressing Alt+F3 to open a virtual terminal. From here, we typed top to view all of the user processes on the system in Top, seeing Fallout4.exe as the first item. killall -9 Fallout4.exe killed the process, and pressing Alt+F7 got us back to the regular desktop. On subsequent runs of the game, we learned to close down cleanly by exiting to the main menu (rather than straight to the desktop) and quitting the game from there. Little workaround­s like this are fairly common when you’re running a Windows game under Proton.

Searching ProtonDB, it turned out that the sound problems we encountere­d are very common for Fallout 4. The solution was to cut and paste WINEDLLOVE­RRI DES="xaudio2_7=n,b” PULSE_LATENCY_MSEC=90 %command% into the launch options of the game. A quick jump back into the game confirmed that this had largely fixed the sound, but it took regressing to an earlier version of Proton, rather than the default experiment­al build, to make it work perfectly.

The mouse problem was a little bit more complicate­d to track down. Sure enough the suggestion, repeated over and over in ProtonDB, to add the line bBackgroun­dMouse=1 to an INI file turned out to be the right one, but we initially had difficulty locating the file because it was duplicated in multiple locations, and it was impossible to figure out if what we were doing was having any effect.

Eventually, we discovered that we needed to alter the Fallout4.ini file located in the compdata folder, within the simulated My Documents Proton folder, rather than the identical file within the game directory itself.

At this point we customized a character and ventured out into the apocalypti­c wasteland, experienci­ng performanc­e that was similar to running the same game on the same hardware via the Windows partition. Success!

 ??  ??
 ??  ??
 ??  ?? Enabling Steam Play within the Steam settings dialog so that we can run both supported and (officially) unsupporte­d Windows games on Linux. Naughty!
Enabling Steam Play within the Steam settings dialog so that we can run both supported and (officially) unsupporte­d Windows games on Linux. Naughty!
 ??  ?? Getting ready to play Firewatch on a laptop without 3D support, thanks to Steam Remote Play streaming.
Getting ready to play Firewatch on a laptop without 3D support, thanks to Steam Remote Play streaming.
 ??  ?? Success! Due to his diligence and commitment to his work, the author put in a few hours of play time in Fallout 4 to make sure it was completely functional.
Success! Due to his diligence and commitment to his work, the author put in a few hours of play time in Fallout 4 to make sure it was completely functional.
 ??  ?? Download in progress. Keep an eye on transfers like these because they can consume a lot of bandwidth, CPU time and storage.
Download in progress. Keep an eye on transfers like these because they can consume a lot of bandwidth, CPU time and storage.
 ??  ?? Examining the compatibil­ity reports for a Metro 2033 on ProtonDB. It looks promising.
Examining the compatibil­ity reports for a Metro 2033 on ProtonDB. It looks promising.

Newspapers in English

Newspapers from Australia