Descent Tutorial

Today I present a tutorial on compiling Descent for your Raspberry Pi running Raspbian.  At the end of this tutorial you should have binaries ready to go and and a playable version of the game Descent.  If you don’t want to wait for the compile, I have the binaries ready for you.  Just skip to the end.

  1. Install the required dependancies
    1. sudo apt-get install libsdl1.2debian libsdl-mixer1.2 libsdl-mixer1.2-dev libsdl-image1.2 libsdl-image1.2-dev libsdl-ttf2.0-0 libsdl-ttf2.0-dev libsdl-net1.2 libsdl-net1.2-dev gcc-4.7 scons libphysfs-dev
  2. cd ~/
  3. mkdir descent
  4. cd descent
  5. Download the needed source code:
    1. wget http://sourceforge.net/projects/dxx-rebirth/files/dxx-rebirth/0.57.3/d1x-rebirth_v0.57.3-src.tar.gz
    2. wget http://sourceforge.net/projects/dxx-rebirth/files/dxx-rebirth/0.57.3/d2x-rebirth_v0.57.3-src.tar.gz
  6. Download the needed patches:
    1. wget http://www-user.tu-chemnitz.de/~heinm/tmp/d1x-rebirth-rpi.diff.gz
    2. wget http://www-user.tu-chemnitz.de/~heinm/tmp/d2x-rebirth-rpi.diff.gz
  7. Unzip the source files and the patches:
    1. tar xvfz d2x-rebirth_v0.57.3-src.tar.gz
    2. tar xvfz d1x-rebirth_v0.57.3-src.tar.gz
    3. gunzip d1x-rebirth-rpi.diff.gz
    4. gunzip d2x-rebirth-rpi.diff.gz
  8. You now have to patch the source code with the diff files.
    1. cd into the source code directories.
      1. Descent 1
        1. cd ~/descent/d1x-rebirth_v0.57.3-src/
        2. patch -p1 < ../d1x-rebirth-rpi.diff
      2. Descent 2
        1. cd ~/descent/d2x-rebirth_v0.57.3-src/
        2. patch -p1 < ../d2x-rebirth-rpi.diff
  9. We are now ready to compile!
  10. On the command line enter these two commands:
    1. export CC=gcc-4.7
    2. export CXX=g++-4.7
  11. Descent 1
    1. cd ~/descent/d1x-rebirth_v0.57.3-src/
    2. scons raspberrypi=1
      1. Wait around 30 – 40 minutes.
      2. If there are no errors you should now have a d1x-rebirth executable file in your directory!
  12. Descent 2
    1. cd ~/descent/d2x-rebirth_v0.57.3-src/
    2. scons raspberrypi=1
      1. Wait around 30 – 40 minutes.
      2. If there are no errors you should now have a d2x-rebirth executable file in your directory!
  13. You now need the data files that holds the actual game levels, sounds, artwork, etc.  These are in .hog, .pig, and .ham (descent 2 only) files.  You can get the game content from dxx-rebirth, the creators of this port.  They also have links to the shareware files:
    1. http://www.dxx-rebirth.com/game-content/
    2. http://www.dxx-rebirth.com/download/dxx/content/descent-pc-shareware.zip
    3. http://www.dxx-rebirth.com/download/dxx/content/descent2-pc-demo.zip
  14. Unzip those files by running unzip filename
  15. copy descent.hog and descent.pig to ~/descent/d1x-rebirth_v0.57.3-src/
  16. copy D2DEMO.HAM, D2DEMO.HOG and D2DEMO.PIG  to ~/descent/d2x-rebirth_v0.57.3-src/
  17. You are now ready to play!
    1. Descent 1
      1. cd ~/descent/d1x-rebirth_v0.57.3-src/
      2. ./d1x-rebirth -hogdir . (yes, thats a period at the end that must be there)
    2. Descent 2
      1. cd ~/descent/d2x-rebirth_v0.57.3-src/
      2. ./d2x-rebirth -hogdir .
  18. ENJOY!!


I realize these are a lot of instructions, but I wanted to make them as verbose as possible.
Below are the precompiled binaries with shareware data files already copied over.

Descent 1 Binaries | Descent 2 Binaries

Please let me know if any of this doesn’t work for you.  I wrote down every single step I did when I compiled it, but I’m afraid I may have missed something.  Let me know and I’ll correct it!

-Shea

25 thoughts on “Descent Tutorial

  1. scons: Reading SConscript files …

    ===== D1X-Rebirth v0.57.3 =====

    compiling on *NIX
    LittleEndian machine detected
    building with OpenGL ES 1.x, library: GLESv2
    including SDL_mixer
    using Raspberry Pi vendor libs in /opt/vc

    scons: done reading SConscript files.
    scons: Building targets …
    Compiling 2d/2dsline.c …
    Compiling 2d/bitblt.c …
    Compiling 2d/bitmap.c …
    Compiling 2d/box.c …
    Compiling 2d/canvas.c …
    Compiling 2d/circle.c …
    Compiling 2d/disc.c …
    Compiling 2d/font.c …
    In file included from main/piggy.h:23:0,
    from main/gamefont.h:25,
    from 2d/font.c:35:
    include/physfsx.h:18:20: fatal error: physfs.h: No such file or directory
    compilation terminated.
    scons: *** [2d/font.o] Error 1
    scons: building terminated because of errors.

    please HELP!

        • make sure you’ve downloaded/copied the hogfiles from a proper source, such as the cds of the original game, or the shareware links above.

          if you drop the hog/ham/pig files into the directory where the d1x-rebirth binary is, all you need to is ./d1x-rebirth -hogdir .

          The period indicates looking in the same directory as you currently are in.

  2. Hi,

    Thanks for this tutorial – I think I’m nearly there, but it’s not *quite* working.

    I get the splash screens, but then it quits with these messages…

    Using SDL_mixer library
    sdl-joystick: found 0 joysticks
    Music descent.hmp could not be loaded: Module format not recognized
    Bus error

    Any ideas what I’ve done wrong? I’ve only tried Descent 1 with the shareware PIG and HOG files.

    Thanks,
    – Chris

  3. This is great, works a treat on my pi, Only issue I’ve found is that if I bump up the resolution and effects then the sound gets really jumpy with lots of pops and clicks. I’ve read elsewhere about the alsa buffer being too small, but have not yet been able to find out how to do anything about it. Oh well I know the sound on the pi is something that is being worked on, hopefully a future update will fix this.

  4. i can’t even get the dependancies installed

    i just keep getting an error

    Unable to locate package scons libphysfs-de

    regards

    Glen

  5. in the first step, installing dependencies, i have found that the package is “sCons” not “scons”
    (however once it’s installed the command to run it is lowercase)

    glen

  6. I cant get this to work on the latest Rasbian. Compiling just throws errors and if I try the binaries (on a clean OS build) ./d1x-rebirth -hogdir . does nothing even with sudo. Am I missing something or just being stupid?

  7. Hi,
    NICE tutorial !

    compiles fine without problem

    but starting shows

    Using SDL_mixer library
    sdl-joystick : found 0 joysticks
    OpenGL not available

    Any ideas what’s missing ?

  8. Wow, nice tutorial but…

    I couldn’t wait for it and tried to run d1 from the binary files. The main menu and the briefing screens run well but the game itself does not. I get random visual artifacts. Sometimes I can see the entrance to level one, then the screen goes white and I lose the cockpit bitmap. Explosion bitmaps are out of scale. The game main loop still runs because I take enemy fire (armor points going down). I can hit also the ESC key to abort game and to return to the main menu.

    Back to the main menu, the background is white but the labels still print OK and menu actions do works. Very strange…

    Here are the details:
    uname -a
    Linux raspberrypi 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST armv6l GNU/Linux
    Hardware is Raspberry PI model B running Raspbian
    Screen resolution set to 640×480, 4/3 aspect ratio, LCD monitor connected via HDMI
    command line: ./d1x-rebirth -nomusic -nosound -nosdlmixer -hogdir .

    Should I prepare for compile?

    Thanks!

    Yves

    • Ah! My bad: only 64 Mb of RAM were allocated to the video display subsystem. I have a game now but one issue left to sort out: no music! All I got was noise: random clicks, pops and hums. Sound effects work.

      What a great classic game!

  9. hi,
    thank you for getting this to work and putting up a step by step tutorial!!

    first error but no biggie: the source packages have moved to:
    wget http://www.dxx-rebirth.com/download/dxx/d1x-rebirth_v0.57.3-src.tar.gz
    wget http://www.dxx-rebirth.com/download/dxx/d2x-rebirth_v0.57.3-src.tar.gz
    (check http://www.dxx-rebirth.com/news/downloads-and-vcs-moving-or-nothing-works/)

    second: better also edit and include scons and libphysfs-dev to the apt-get line in step 1

    and lastly: i run into an error at step 11

    scons raspberrypi=1
    scons: Reading SConscript files …

    ===== D1X-Rebirth v0.57.3 =====

    compiling on *NIX
    /bin/sh: 1: sdl-config: not found
    OSError: ‘sdl-config –cflags’ exited 127:
    File “/home/pi/descent/d1x-rebirth_v0.57.3-src/SConstruct”, line 348:
    env.ParseConfig(‘sdl-config –cflags’)
    File “/usr/lib/scons/SCons/Environment.py”, line 1551:
    return function(self, self.backtick(command))
    File “/usr/lib/scons/SCons/Environment.py”, line 593:
    raise OSError(“‘%s’ exited %d” % (command, status))

    how come i dont have that sdl-config ?
    please help!

    best regards, Newk

  10. On Raspbmc (updated today, 30/7/2013), you need to download other packages first:
    libsdl1.2-dev
    libpulse-dev
    libavahi-client-dev
    libavahi-client3
    libavahi-client-dev
    libpulse-dev
    libsdl1.2-dev

  11. We got an error containing “Couldn’t find matching GLX visual” and found, after lots of cursing and re-reading, that we had typed “scons rasberrypi=1” where we meant “scons raspberrypi=1”. Just in case anyone else gets that.

    Also, we downloaded a newer version from dxx-rebirth.com that includes the patch and the README.RPi.

    • I typo’ed the raspberrypi=1 option and I got an opengl error when I tried to run the resulting binary. (did a scons -c and recompiled and it fixed it)

  12. Please update this for the 0.58.1 version of descent-rebirth…. it no longer requires any of the patches!

  13. getting “Error: Could not set 650x480x32 opengl video mode: Couldn’t find matching GLX visual”

    I tried scons rasberrypi=1
    then scons -c
    then scons rasberrypi=1

    I don’t know what to do next. Suggestions?

Leave a Reply

Your email address will not be published. Required fields are marked *