Since this is a topic that's still generating questions, and since there have been some significant recent changes to the optimal setup, I've decided to write new guide to installing GW on Linux. This guide is current as of May 2020.
In this guide, we're going to:
- Use a protonified version of Wine for maximum performance.
- If possible, install d9vk for even better performance.
- Install uMod for using texture mods.
- Install DirectSong and ALL of the bonus music.
- We're NOT going to use some automated solution like Lutris. Rather we're going to do everything by hand so we know what we did in case something needs tweaked later.
Setting Up BiArch:
Most people who game on Linux or use Wine already did this long ago. In which case, you can skip this section. For those who haven't:
sudo dpkg --add-architecture i386 sudo apt update
- Install the i386 packages for your video driver.
- Install ordinary Wine, installing all recommended and suggested packages. This should pull in a whole bunch of i386 dependencies.
Getting the Steam runtime environment:
Protonified Wine builds are intended to be used with the Steam runtime. I'm not aware of any breakage if you don't do this (at least not on Debian), but I can't guarantee that, and it's easy to set up anyway.
- If you haven't already, install Steam.
- If you haven't already, install any game using Proton.
Getting Protonified Wine:
Glorious Eggroll does a wonderful community service by integrating the Proton patches (plus some other gaming/performance patches) into the latest versions of Wine. It's the best of both worlds -- up-to-date Wine and Proton's enhancements.
- Download the latest build from Glorious Eggroll. (At this time, the latest build is Proton-5.6-GE-2, so that's what this guide refers to. Adjust references accordingly for newer releases.)
- Unzip to wherever you like. (This guide is going to call this location "<eggroll\_path>." Replace references to <eggroll\_path> with the actual path.)
- No need to worry about dependencies so long as you already installed ordinary Wine.
Raising File Descriptor Limits for Esync:
Esync is a Wine optimization in protonified builds that reduces wineserver overhead for synchronization objects, which can substantially improve performance, especially if you're CPU-bound. Esync consumes a very large number of file descriptors, potentially exceeding the default per-process limit in some Linux distros. To raise the limit:
- Edit /etc/security/limits.conf to add the following (and comment out any existing reference to hard nofile).
* hard nofile 1048576
- If your distro uses sytemd, then edit both /etc/systemd/system.conf and /etc/systemd/user.conf to add the following (and comment out any existing reference to DefaultLimitNOFILE).
DefaultLimitNOFILE=1048576
Setting Up A New Wine Prefix for GW:
- Open a console and export a bunch of environment variables regarding which Wine version we want to use, as follows (replacing <username> with your real username):
export WINEVERPATH="<eggroll_path>/dist" export WINELOADER="<eggroll_path>/dist/bin/wine" export WINESERVER="<eggroll_path>/dist/bin/wineserver" export WINEDLLPATH="<eggroll_path>/dist/lib64/wine":"<eggroll_path>/dist/lib/wine" export LD_LIBRARY_PATH="<eggroll_path>/dist/lib64":"<eggroll_path>/dist/lib":/home/<username>/.local/share/Steam/ubuntu12_32/steam-runtime/pinned_libs_32:/home/<username>/.local/share/Steam/ubuntu12_32/steam-runtime/pinned_libs_64:/usr/lib/x86_64-linux-gnu/libfakeroot:/lib/i386-linux-gnu:/usr/local/lib:/usr/lib/mesa-diverted/i386-linux-gnu:/lib/x86_64-linux-gnu:/lib32:/lib:/lib/i386-linux-gnu/i686:/lib/i386-linux-gnu/sse2:/lib/i386-linux-gnu/i686/sse2:/home/<username>/.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu:/home/<username>/.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib:/home/<username>/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu:/home/<username>/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib:/home/<username>/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/lib/x86_64-linux-gnu:/home/<username>/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/lib:/home/<username>/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu:/home/<username>/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib export PATH="<eggroll_path>/dist/bin:$PATH" export WINE="<eggroll_path>/dist/bin/wine" export STEAM_COMPAT_DATA_PATH=~/.steam/steam/steamapps/compatdata
- In the same console, specify the path for the new wine prefix. (You don't have to use this name; adjust accordingly if you use something else.)
export WINEPREFIX=/home/<username>/.wine-gw-protonGEd9vk
- Specify that we want a win32 wine prefix.
export WINEARCH=win32
winecfg
- Make sure to keep this console open. We're not done with it yet.
Installing D9VK:
D9VK is a DirectX9-to-Vulkan compatibility layer. It generally offers better performance than Wine's built-in DirectX-to-OpenGL implementation. (For example, it improves my uncapped FPS sitting in my guild hall from ~220 to ~380.) As best I can tell, all of the bugs relevant to GW have been ironed out, so it should look flawless.
- First, make sure that your video card/drivers are new enough that you can run d9vk. Consult this page. If your system is not able to run d9vk, then SKIP THIS SECTION.
- The latest d9vk binaries are bundled with Glorious Eggroll's Wine builds, so you don't need to download them. If you're using a different build of Wine, you can download them here.
- Change the working directory to the wine prefix's system32 directory.
cd ~/.wine-gw-protonGEd9vk/drive_c/windows/system32
- Delete the following files:
rm d3d9.dll rm d3d10.dll rm d3d10_1.dll rm d3d10core.dll rm d3d11.dll rm dxgi.dll
- Create symlinks pointing to the d9vk (and dxvk) binaries.
ln -s <eggroll_path>/dist/lib.wine/dxvk/d3d9.dll d3d9.dll ln -s <eggroll_path>/dist/lib.wine/dxvk/d3d10.dll d3d10.dll ln -s <eggroll_path>/dist/lib.wine/dxvk/d3d10_1.dll d3d10_1.dll ln -s <eggroll_path>/dist/lib.wine/dxvk/d3d10core.dll d3d10core.dll ln -s <eggroll_path>/dist/lib.wine/dxvk/d3d11.dll d3d11.dll ln -s <eggroll_path>/dist/lib.wine/dxvk/dxgi.dll dxgi.dll ln -s <eggroll_path>/dist/lib.wine/dxvk/dxvk_config.dll dxvk_config.dll ln -s <eggroll_path>/dist/lib.wine/dxvk/openvr_api_dxvk.dll openvr_api_dxvk.dll
- Run winecfg again (from the same console with all those exports) and add library overrides for the eight .dll's we just made symlinks for.
- (Later when we get to the launcher script, you can comment out the lines for the GL shader cache, since we're not using OpenGL for GW anymore. (D9VK will generate a Vulkan shader cache for us.))
Installing DirectSong and the Bonus Music:
- Make sure the i386 version of libmpg123 is installed.
sudo apt-get install libmpg123-0:i386
- Download winetricks. If you already have winetricks installed, make sure to update to the newest version.
- Use winetricks to install Windows Media Player 10 (from the same console with all those exports).
winetricks -q wmp10
Run Windows Media Player 10 one time (from the same console with all those exports).
- Suffer through the first-run dialogs. (Note: There's some funky, buggy behavior when you uncheck file associations (which you almost certainly don't want). You can get around it by toggling to the other tab of the dialog and back again after unchecking each box.)
- Test that mp3 playback is indeed working. (Note: MP3 playback via Windows Media Player 10 was finally fixed to work out-of-the-box in Wine 4.12. Getting it to work in older versions of Wine is a headache.)
wine "C:\Program Files\Windows Media Player\wmplayer.exe"
- Download the DirectSong Revival Pack. (See also reddit thread).
- Extract the DirectSong/ directory from the revival pack to any location in the wine prefix you like. (This guide is going to use ~/.wine-gw-protonGEd9vk/drive_c/DirectSong . Adjust accordingly if you use something else.)
- Install GW as per the instructions below, then come back for the final step for DirectSong.
- Run RegisterDirectSongDirectory.exe (from the same console with all those exports) using DirectSong installation location as the working directory.
wine start /d "C:\DirectSong" "C:\DirectSong\RegisterDirectSongDirectory.exe"
Actually Installing Guild Wars:
- Download the GW client and save it somewhere in the wine prefix.
- Run the installer (from the same console with all those exports).
wine C:\<path_to_installer>\GwSetup.exe
- Optionally, run GW (from the same console with all those exports) with the -image switch to download a complete dat file.
wine start /d "C:\Program Files\Guild Wars" "C:\Program Files\Guild Wars\Gw.exe" -image
- Run winecfg again (from the same console with all those exports) and set the Windows version to XP. This should enable GW's "use 3D audio hardware" option, so you can get the original directional sound effects that haven't worked in Windows since XP. Also check the EAX option in winecfg's "staging" tab. This should enable GW's "use EAX" option, so you can get the DSP effects that expensive soundcards provided back in the day.
- (Unfortunately, Wine's EAX implementation only supports up to EAX v2, and GW uses features up through EAX v4, so you won't get the full EAX experience. There is a dsound .dll replacement named DSOAL (repo.or.cz, github) that implements EAX v4. Unfortunately, however, it has the side effect of silencing GW's music. Perhaps at some future time the bugs will be worked out.)
- Note: With Wine configured to simulate Windows XP, GW will look for build templates in ~/.wine-gw-protonGEd9vk/drive_c/Program Files/Guild Wars/Templates. (If simulating a higher version of Windows, it's instead ~/.wine-gw-protonGEd9vk/drive_c/users/steamuser/My Documents/Guild Wars/Templates/ .) You might find it useful to delete this directory and replace it with a symlink to a more convenient location in you Linux user directory.
- (Now go back and finish that last step for installing DirectSong.)
Installing uMod:
- Download uMod v1r44 from here or here.
- Unzip to some location inside the WINE prefix. (This guide uses C:\Program Files\uMod . Adjust accordingly if you use something else.)
- Note: You will want to use the "start game through uMod" feature. It's the only one that works reliably in WINE.
Creating a Launcher Script:
- Copy the following into a text editor and adjust the paths as necessary:
#!/bin/sh #set up environment variables to use alternate wine binaries export WINEVERPATH="<eggroll_path>/dist" export WINELOADER="<eggroll_path>/dist/bin/wine" export WINESERVER="<eggroll_path>/dist/bin/wineserver" export WINEDLLPATH="<eggroll_path>/dist/lib64/wine":"<eggroll_path>/dist/lib/wine" # set up LD_LIBARY_PATH the same as Proton does, except using our alternate wine libs instead of proton libs export LD_LIBRARY_PATH="<eggroll_path>/dist/lib64":"<eggroll_path>/dist/lib":/home/<username>/.local/share/Steam/ubuntu12_32/steam-runtime/pinned_libs_32:/home/<username>/.local/share/Steam/ubuntu12_32/steam-runtime/pinned_libs_64:/usr/lib/x86_64-linux-gnu/libfakeroot:/lib/i386-linux-gnu:/usr/local/lib:/usr/lib/mesa-diverted/i386-linux-gnu:/lib/x86_64-linux-gnu:/lib32:/lib:/lib/i386-linux-gnu/i686:/lib/i386-linux-gnu/sse2:/lib/i386-linux-gnu/i686/sse2:/home/<username>/.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu:/home/<username>/.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib:/home/<username>/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu:/home/<username>/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib:/home/<username>/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/lib/x86_64-linux-gnu:/home/<username>/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/lib:/home/<username>/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu:/home/<username>/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib export PATH="<eggroll_path>/dist/bin:$PATH" # this one's for winetricks export WINE="<eggroll_path>/dist/bin/wine" export STEAM_COMPAT_DATA_PATH=~/.steam/steam/steamapps/compatdata # turn on esync for improved performance export WINEESYNC=1 # The following two lines are not needed if you installed d9vk, so you can comment them out export __GL_SHADER_DISK_CACHE=1 export __GL_SHADER_DISK_CACHE_PATH=/home/<username>/.wine-gw-protonGEd9vk/drive_c/shadercache # disable IME keybindings so that game can use ctrl+space and such export XMODIFIERS="" export GTK_IM_MODULE="" export QT_IM_MODULE="" # disable debug messages for improved performance export WINEDEBUG=-all # set wine prefix export WINEPREFIX=/home/<username>/.wine-gw-protonGEd9vk # screen barf what we did echo "Set up environment variables for Glorious Eggroll build of Wine" echo "WINEVERPATH is:" echo $WINEVERPATH echo "WINE is:" echo $WINE echo "WINELOADER is:" echo $WINELOADER echo "WINESERVER is:" echo $WINESERVER echo "WINEDLLPATH is:" echo $WINEDLLPATH echo "LD_LIBRARY_PATH is:" echo $LD_LIBRARY_PATH echo "PATH is:" echo $PATH echo "Set up environment variables for performance" echo "WINEESYNC is: " echo $WINEESYNC echo "WINEDEBUG is:" echo $WINEDEBUG echo "Set up environment variables to disable IME keybindings" echo "XMODIFIERS is:" echo $XMODIFIERS echo "GTK_IM_MODULE is:" echo $GTK_IM_MODULE echo "QT_IM_MODULE is:" echo $QT_IM_MODULE echo "Set Wine prefix." echo "WINEPREFIX is:" echo $WINEPREFIX echo "Starting Guild Wars (uMod)..." #wine winecfg #wine start /d "C:\Program Files\Guild Wars" "C:\Program Files\Guild Wars\Gw.exe" -image wine start /d "C:\Program Files\uMod" "C:\Program Files\uMod\uMod.exe"
chmod +x <script_name>
- Create a start menu and/or desktop shortcut pointing to the launcher script. Now you can start GW via the shortcut.
Updating:
To update for a new version of Wine, just edit the launcher script to point to the new binaries. To update d9vk, update the symlinks to point to the new binaries.
FAQ:
- Q: Can I just use ordinary Wine?A: Yes, you can. Just ignore the sections on protonified Wine, the Steam runtime, and esync, and omit the export statements relating to them. If you want d9vk, you'll have to download the binaries.
- Q: Can I use Proton instead of some random person's protonified Wine?A: Yes, you can, but you will need to use Proton 5.0 (or newer) if you want DirectSong to work. Change the exports pointing to Glorious Eggroll's build to instead point to the Proton binaries, and use the d9vk/dxvk binaries that came with Proton.
- Q: Can I just use Lutris?A: Go ahead, but don't ask me how to fix it when some outdated install script sets something wrong or breaks things altogether.
- Q: Will this work on Mac?A: Sort of... The first major roadblock is that MacOS dropped all 32-bit system libraries as of Catalina. Presently, the only option for running 32-bit programs on Catalina is Crossover, the paid version of Wine. For older versions of MacOS, any version of Wine should be able to at least run GW. So far as I know, there are no protonified versions of Wine available for Mac. There is no Steam runtime because there is no Steam for Mac. D9VK will not work because MacOS has no Vulkan drivers. (There is a third-party Vulkan-to-Metal translation layer called MoltenVK that is not presently able to run d9vk, but might be able to in the future.)
- Q: GW is sporadically crashing on launch.A: This is an ongoing issue that comes and goes with new versions of Wine. I have no idea what's causing it. Just kill the zombie Gw.exe process from the task manager and try again.
- Q: How can I multilaunch?A: Just make multiple wine prefixes.
- Q: What about toolbox?A: Don't ask me; I don't use toolbox.
No comments:
Post a Comment