Half-Life 2: Deathmatch on Linux

August 11th, 2007 | Ubuntu, Games, Linux by th

Tips and tricks to get Half-Life 2: Deathmatch running on Linux.

Although there is several good free fps games available for Linux - I just love HL2DM. I’ve spent countless hours trying to hack Wine to run it, without much success. The original single player Half-Life 2 runs fine with Wine, even HL2DM runs fine when playing locally. But joining online game always crashed it. Gladly, someone came up with a solution! Wine has lately improved by amazing leaps, even DirectX support is nowadays pretty good, and performance with HL2DM is pretty amazing compared to a few months back. And now I have HL2DM running on resolution 1440×900 and medium details smoothly. Granted - A little performance hit, in Windows my machine could handle full details. But I can barely notice any difference.


Getting started

You need a few things and a little knowledge to do this, but it’s not hard. You should have:

  • Working compiler toolchain
  • Required libraries installed (See Wine documentation). If you’re lazy to read, just try to configure it and install missing libraries one by one.
  • This patch
  • Wine 0.9.42 source code
  • Steam Installer
  • (Checkinstall highly recommended)

This tutorial was written using Ubuntu Linux - your mileage may vary depending on the distribution. If you’re running Ubuntu (Feisty, Gutsy (or later)), I also have precompiled and patched wine .deb available (Download) if you don’t want to recompile wine yourself. It’s compiled with Gutsy Gibbon (7.10) and against /opt like in this tutorial, so it co-works with official Ubuntu Wine packages. The patch is also available at Wines Bugzilla page for bug 7698 - read all comments carefully!

Patching the Wine

First we need to compile and patch Wine. This is pretty simple process as long as you got working compiler toolchain:

cd /tmp

wget http://prdownloads.sourceforge.net/wine/wine-0.9.42.tar.bz2

tar jxvf wine-0.9.42.tar.bz2

cd wine-0.9.42/

wget http://kahvipapu.com/downloads/hl2dm.patch

patch -p1 < hl2dm.patch

Now you got patched Wine source code prepared. The patch file is simply plain text diff, you can take a look at it with any text editor. The actual patch modifies file dlls/gdi32/freetype.c and fixes (apparently a font-centric problem) the crashing problem with HL2DM.

Compiling the Wine

And now the fun part - Compiling the Wine. Note that we compile wine to /opt here so it doesn’t conflict with distributions own Wine packages.

./configure –prefix=/opt && make depend && make

Configure might give some errors for you about missing libraries - Install the missing libraries with your distributions package manager and re-run the command until it compiles. To create easily installable and uninstallable .deb file for Ubuntu, we’ll install checkinstall first. Checkinstall can also create .rpm packages if your distribution uses rpm. Just change -D flag to -R (and -S for Slackware).

sudo apt-get install checkinstall

checkinstall -D -y

dpkg -i *.deb

Now you should have patched Wine installed. Run winecfg to configure your brand new Wine.

Getting Steam

If you don’t have Steam installed yet - download it first (mirrored by me, newest Steam installers won’t work under Wine)

(UPDATE: Apparently wine can run new Steam installers (wine msiexec /i SteamInstall.exe) so you can download SteamInstall also from official Steam homepage.)

wget http://kahvipapu.com/downloads/SteamInstall.exe

/opt/bin/wine SteamInstall.exe -dxlevel 90 -novid

Steam installer should finish without problems. When you have Steam running, install Half-Life 2: Deathmatch through Steam. Installing from CD won’t work, which is a bit shame. When installed, HL2DM should work perfectly! Episode 1 works with this too.

Remember to run steam.exe (or hl2dm.exe) with parameters: -dxlevel 90 -novid

Happy fragging!

If you’d love to be able to create video games as much as you play them, a video game design degree would be a good choice. Online college degrees are perfect for busy people on the go, and you can get either your online MBA or Bachelor degree.

4 Responses to “Half-Life 2: Deathmatch on Linux”

  1. University Update - Linux - Half-Life 2: Deathmatch on Linux |

    […] Contact the Webmaster Link to Article linux Half-Life 2: Deathmatch on Linux » Posted at kahvipapu | Half-Life 2: […]

  2. Half-Life 2: Deathmatch on Linux |

    […] things            Half-Life 2: Deathmatch on Linux Tips and tricks to get Half-Life 2: Deathmatch running on Linux. Read More Sat, 11 Aug 2007 […]

  3. Patricia |

    I usually do not play games but my boy-friend is crazy about this very game! He’s constantly playing it and I cannot stop him. But maybe, it’s for the better??!!…

  4. Dennis Lidster |

    Hi, I am having a problem alot like this. mine works and attempts to connect to the server, but gets suck at sending client info.

    I have reinstalled ubuntu countless times and tried cedega, wine & crossover. but i cannot get it to connect, so i will give this a shot and see what happens. Thanks for the info.


Leave a Reply

For spam detection purposes, please copy the number 9299 to the field below: