Linux support

From SWAT 4 wiki
Jump to navigationJump to search

SWAT 4 should work fine on Wine with a 64bit prefix and no tricks should be required. Below is the manual way of doing it and also a couple of other options that'll help you run it.

Manual Method

Getting Wine and DXVK

You're going to need Wine. You can download it from the package manager of your distro. For Arch and Arch-based distros you'll need pacman -S wine. For Debian and Ubuntu-based distros it's recommended to go to WineHQ, as the distro repositories serve heavily outdated versions. Any other distros, refer to your own resources.

For DXVK, you'll need to download the latest release on Github.

Creating a Prefix

To contain the game, we'll need a prefix. Run WINEARCH=win64 WINEPREFIX=/path/to/where/you/want/your/prefix wineboot -u. This will mimic a Windows file system which you can modify.

Always use a separate prefix for all things and never use the default one, as it messes up your MIMEs. Never run Wine as sudo.

Installing The Game and DXVK

Ideally you'll want to install the game, move the files over to a fresh prefix and delete the old one, as it often installs dependencies for Windows which may cause issues. While using the same prefix may sometimes work, it should be the first step to resolving any issues.

Install it by running WINEARCH=win64 WINEPREFIX=/path/to/your/prefix wine path/to/installer.exe.

Now you need to install DXVK on top. Extract the DXVK archive to wherever you'd like and cd into that folder. From there run WINEPREFIX=/path/to/your/prefix ./setup_dxvk.sh install and that should apply DXVK.

Running The Game

To run the game, make sure to not just use wine without specifying a prefix. So, go ahead and run cd '/path/to/your/prefix/drive_c/GOG Games/SWAT 4/ContentExpansion/System'; WINEPREFIX=/path/to/your/prefix wine Swat4X.exe (Content folder if you want the original game, removing the X from file names) and the game should run just fine.

You can create a shortcut for running your game. For example, if you have bash, creating a .desktop file in $HOME/.local/share/applications and under the exec= field, type /bin/sh -c "" and in quotes, the command you've used to launch the game.

Helper Programs

There are multiple programs that aim to create a front-end to manage Wine and Wine-related things or be a one-stop-shop to launch your games. Here are a couple of options that may be worthwhile.

Lutris

Lutris is a universal game manager that'll help you accomplish the steps above with more ease. Plenty of resources online to help you get started. No point in linking any, as the software is under active development, so look it up on the internet.

Lutris also features install scripts, here's one for SWAT 4: Gold Edition + SEF that does the same thing as listed above.

Bottles

Bottles tries to fill in a gap for all your Windows programs. It sports a very basic GNOME-style interface with only the essential features. It has easy version management and covers pretty much all bases to help you get your prefixes sorted out in a user-friendly way.

General Info

Modding

Modding is the same as on Windows. You'll have to launch the same relevant things as described in the mod you're trying to download. Mimic the steps into the prefix you created, as you would on Windows. For example, launching SEF and SEF-based mods you'll have to navigate to the mod folder and launch the .exe in the Extras folder.

Troubleshooting

If it crashes on changing the resolution, you'll have to edit Swat4X.ini in the System folder of the module you're running, changing FullscreenViewportX and FullscreenViewportY values under [WinDrv.WindowsClient] to your resolution.

If you want to check if DXVK is running or want a performance HUD, add DXVK_HUD=1 before the WINEPREFIX, everything stays the same. If you're on Lutris, go to System options and scroll down to Environment variables. Click on Add, then add DXVK_HUD under Key, then add 1 under Value.

If on your system you get any errors or performance issues, try Lutris or fiddle with winetricks. Some older games have issues with Wine engines past 5.13, you might want to try an engine before 5.13. Or you can try a custom engine, such as wine-tkg.

You can try a 32bit prefix, by replacing WINEARCH=win64 with WINEARCH=win32 when creating it.

Worthwhile Winetricks to install may be d3dx9 and d3dcompiler_47. Install winetricks package if you don't have it already. Run WINEPREFIX=/path/to/your/prefix winetricks and follow GUI prompts. Ignore any errors and after it's done, I recommend switching to Windows 7 on winecfg.

If your cursor stays on-screen while you're in-game, it's a DXVK issue and you'll need to downgrade to v1.7.3L or experiment with older/newer DXVK versions.