How To Run GTA2 in Linux

GTA2 in Linux (KDE4), running DAFE's Death Valley in dusk.

Sections:

Software you will need

You need the following software to complete this tutorial:

  • Wine, a program that lets you run Windows software on other operating systems.
  • winetricks, a time-saving script to download and install various redistributable runtime libraries sometimes needed to run programs in Wine.
  • GTA2 GameHunter, a free (no malware, no bullshit) application for finding and playing with human GTA2 opponents.
  • GTA2, the best multiplayer game ever. The GTA2 version from www.gtamp.com/gta2/ is the best and only recommended version. It started off as the official free version of GTA2 available from RockstarGames.com but it was patched to fix many of the bugs present in GTA, and it also contains some new features. See the changelog in the installation folder for more info. It contains no spyware, adware or shit of any sort.

Note: As you should know, it is best to install these programs using your distribution's package management software. Ubuntu uses Aptitude, Gentoo uses Portage, Fedora uses Yum, etc.

How to run GTA2 in Linux

Paste and run this code from a console of your choice.

  1. Install Wine-1.2 or newer.
    In Ubuntu, you'd type this in a console:
    sudo apt-get install wine
    In Gentoo you'd type:
    sudo emerge wine
  2. Copypasta this script to automatically get GTA2 (GTAMP Edition), GameHunter, and the two dependencies Visual Basic 6.0 Runtime Service Pack 6 and DirectPlay (part of DirectX):
    tmpdir=$(mktemp -d /tmp/gta2-XXXX) && \
    trap 'rm -rvf "$tmpdir"; exit' EXIT && \
    cd ${tmpdir} && \
    printf "%s\n" "Getting winetricks and installing Visual Basic 6.0 Runtime Service Pack 6 and DirectPlay" && \
    wget http://www.kegel.com/wine/winetricks && \
    mkdir -p ~/.cache/winetricks/vb6run && \
    wget -O "$HOME/.cache/winetricks/vb6run/VB6.0-KB290887-X86.exe" http://gtamp.com/misc/vb6.0-kb290887-x86.exe && \
    sh winetricks -q directplay vb6run 2> /dev/null && \
    wget --trust-server-names http://gtamp.com/GTA2/gta2-installer.exe http://gtamp.com/GTA2/gh && \
    mkdir -pv ~/.wine/drive_c/games && \
    printf "%s\n" "Installing GTA2" && \
    wine gta2-installer.exe \/S \/D=C:\\games\\GTA2\\ 2> /dev/null && \
    printf "%s\n" "Installing GameHunter" && \
    wine gta2gh*setup.exe \/S \/D=C:\\games\\GTA2\\gh\\ 2> /dev/null && \
    printf "%s\n" "Adding GTA2 Manager keys to registry" && \
    wine regedit ~/.wine/drive_c/games/GTA2/gta2_install.reg 2> /dev/null && \
    cd ~ && \
    printf "%s\n" "Everything done, installation complete." "To run GameHunter, type:" "wine ~/.wine/drive_c/games/GTA2/gh/gta2gh.exe"
    
  3. Run GameHunter, open Tools > Settings and enter a GTA2 name (a name you want to use in GTA2), an IRC name (a name you want to use in GameHunter), GTA2 folder ( c:\games\GTA2\ ), tick "connect on startup", "sign in automatically", "highlight own words" and "mute alert sounds while GTA2 is open" and choose a sound to play to notify you when players join your game and when your nick is written in the chat. Notice the password field - you do not need to fill this in unless you have registered your nickname. If you are a frequent GameHunter user, it is recommended that you do this. See this GTAMP forum post for more information.
    IMPORTANT: turn off "timestamp messages" - if you enable timestamps, GTA2.exe will crash!
  4. GameHunter 1.59 showing Salamander hosting DAFE's Death Valley. GameHunter options, Main tab. GameHunter options, Audio tab. GameHunter options, Display tab. Turn off 'Timestamp messages' to prevent Network GTA2 from crashing.
  5. When you're in GameHunter press F8 to run GTA2 Manager to set GTA2 up. Remember to set "Display mode" to "Window", otherwise your desktop resolution will get switched to 640x480 while playing GTA2. Setting the GTA2 resolution to 960 x 720 makes for nice screencasts if you plan on recording your games (720p). To set GTA2 to 960x720 you will need to run regedit, go to HKEY_CURRENT_USER\Software\DMA Design Ltd\GTA2\screen and set "full_height" and "window_height" to decimal 720, and "full_width" and "window_width" to decimal 960. Don't turn anything on in the Debug tab other than what is in my screenshot. Don't change anything in the Physics tab, otherwise you won't be able to play online.
  6. GTA2 Manager, Welcome tab. GTA2 Manager, Video tab. GTA2 Manager, Audio tab. GTA2 Manager, Control tab. GTA2 Manager, Network tab. GTA2 Manager, Debug tab. Only turn 'Show Instruments' and 'Do Blood' on, nothing else.

    That's it! As far as Linux is concerned, you are now ready to play.

    Unfortunately GTA2 is an old game and although you got everything running correctly so far, you might not be able to enjoy multiplayer games just yet. If you try joining other players and the "Network GTA2" window pops up but the "join" button is disabled, then either you or the person you are trying to join need to forward your ports. Read http://gtamp.com/gta2/network-help/ very carefully. Forwarding ports only takes one minute once you've done it before, but you will need to pay attention and read carefully if this is your first time. You only ever need to do this once, unless you change routers or your network setup somehow changes.

  7. addendum 1: Using winetricks in step 3 is a great way of saving you some work, but it can be done manually if, for some unholy reason, you feel you need to. You don't need to (and shouldn't) do this if you did step 3.
    1. Download and copy directplay files to windows/system32 so that you can use TCP/IP:
      tmpdir=$(mktemp -d /tmp/directplay-XXXX) || exit
      trap 'rm -rvf "$tmpdir"; exit' EXIT
      cd ${tmpdir}
      wget http://www.thehandofagony.com/alex/dll/dplaydlls-win98se.tar.bz2
      tar -xjf dplaydlls-win98se.tar.bz2 || exit
      mv -vt ~/.wine/drive_c/windows/system32/ *.exe *.dll
      rm -rvf "${tmpdir}"
    2. Register the directplay files using windows regsvr32:
      wine regsvr32 dplayx.dll
      wine regsvr32 dpnet.dll
      wine regsvr32 dpnhpast.dll
    3. Add DLL overrides (native,builtin) for dplayx, dpnet, dpnhpast and dpwsockx in "winecfg".
      $ winecfg

Awesome design by DrSlony
www.gta2.seeitmyway.org