Downloading and Compiling under Linux
This page documents how to compile iodoom3 under linux.
Contents |
Downloading
The original source code was released by ID's Timothee Besset on his GitHub account (https://github.com/TTimo/doom3.gpl).
The iodoom3 source code is kept in a repository on git.iodoom.org. It can be cloned to your computer with the following command.
$ git clone git://git.iodoom.org/iodoom3/iodoom3.git
NOTE: For the previous command to work you will need git installed on your system. This is how you install it on Ubuntu 11.04 (and probably many other Debian-based distros):
$ sudo apt-get install git
... if you have never used "git", it might seem a bit confusing at the beginning, but learning how to use it is well worth the time. Here you will find a nice tutorial.
You can install git-all package if you want more git utilities.
Preparing for compilation
Doom 3's needs several packages installed on your system in order to compile it:
-
sconsfor the build process -
gcc(and friends) for the compilation and linkage (Note: If you are compiling for 32bit from 64bit you need gcc-multilib for your distro) - External libraries, such as...
Each Linux distro installs these packages in a slightly different way.
On Ubuntu, issue the following command:
$ sudo apt-get install scons m4 build-essential zlib1g-dev libopenal-dev libxxf86vm-dev mesa-common-dev libasound2-dev
if you are on a 64bit distro, you probably need:
$ sudo apt-get install ia32-libs libc6-dev-i386 lib32gcc1 g++-multilib gcc-multilib
On a fresh Ubuntu you might have to install some other additional ones (please, if this is your situation, update this wiki by adding these extra packages you had to install to the command above). Under x86-64 g++-multilib is required. It may be a better idea to wait until the code is 64-bit clean so a 64-bit compile can be done (as opposed to -m32 build).
Compiling
Once everything is installed, compiling should be as simple as this:
$ cd doom3.gpl/neo $ scons
Note: For 64bit you may need to build with scons NOCURL=1
However, before issuing these commands, depending on your particular Linux distro, you might have to perform some extra tweaks...
OpenSUSE
here what you need to compile iodoom3 on openSUSE 12.1. Just install through Zypper or YaST the following packages:
xorg-x11-libXext-devel-32bit, xorg-x11-devel-32bit, gcc46-32bit, xorg-x11-libX11-devel-32bit, m4, libopenal-soft-devel, glibc-devel-32bit, zlib-devel.
So, for example, using "su":
su -c "zypper in git xorg-x11-libXext-devel-32bit xorg-x11-devel-32bit gcc46-32bit xorg-x11-libX11-devel-32bit m4 libopenal-soft-devel glibc-devel-32bit zlib-devel"
or, same way, with sudo:
sudo zypper in git xorg-x11-libXext-devel-32bit xorg-x11-devel-32bit gcc46-32bit xorg-x11-libX11-devel-32bit m4 libopenal-soft-devel glibc-devel-32bit zlib-devel
Arch
This PKGBUILD will do the trick quite nicely. Extract the tarball, cd to it and run makepkg as ever.
Ubuntu
There is a "hard" reference to file "/usr/lib/libz.a" in file "doom3.gpl/neo/sys/scons/SConscript.curl". Change it to /usr/lib/i386-linux-gnu/libz.a
...which is where this file can be found in Ubuntu.
Fedora
Required Packages:
$ sudo yum install scons libX11-devel.i686 libXext-devel.i686 libXxf86vm-devel.i686 libXxf86vm-devel.i686 openal-soft-devel.i686
libz notes:
For libcurl to compile on 64 bit versions of Fedora, you'll have to download zlib and compile it yourself (with ./configure --static). You will have to modify the Makefile to change the arch. It is highly suggested you currently disable libcurl on 64bit systems unless you feel comfortable editing the iodoom3 scons.
Hardware Specific:
Nvidia Drivers: 32 bit versions of libgl are currently required, you will need to install xorg-x11-drv-nvidia-libs.i686. If you attempt to run iodoom3 without the 32 bit versions installed, you'll likely see the following error:
Fatal X Error:
Major opcode of failed request: 105
Minor opcode of failed request: 0
Serial number of failed request: 42
BadValue (integer parameter out of range for operation)
Fatal X Error:
Major opcode of failed request: 2
Minor opcode of failed request: 0
Serial number of failed request: 46
BadWindow (invalid Window parameter)
Fatal X Error:
Major opcode of failed request: 4
Minor opcode of failed request: 0
Serial number of failed request: 47
BadWindow (invalid Window parameter)
Sys_Error: Unable to initialize OpenGL
Pulse Audio:
Audio will not work with pulseaudio running:
$ killall pulse && ./doom3.x86
Pulse will start up again when another application requires audio.
Executing
The final binary will be placed in the "doom3.gpl" folder, and it's called "doom.x86" (for the x86 arch, obviously)
Before you run it, remember to setup the original Doom3 data and keys.
Setting up the original Doom3 data
Doom 3's engine is licensed under the GPL, but the game contents itself (maps, textures, scripts...) are not. You need to go and obtain a copy of this content and place it somewhere where the engine can find it.
The "original data" can be found on Doom 3's CD (or somewhere else if you bought it from Steam) and is made up of a set of "*.pk4" files. Here I present them and their "md5sum" hash:
71b8d37b2444d3d86a36fd61783844fe pak000.pk4 4bc4f3ba04ec2b4f4837be40e840a3c1 pak001.pk4 fa84069e9642ad9aa4b49624150cc345 pak002.pk4 f22d8464997924e4913e467e7d62d5fe pak003.pk4 38561a3c73f93f2e6fd31abf1d4e9102 pak004.pk4
There are several places where the engine "looks for" these files. For example:
/usr/local/games/doom3/base/
This, however, can be changed by issuing the following parameter when you run the game
+set fs_basepath LOCATION OF NEW BASE PATH
If you also have the data for the Resurrection of Evil Expansion Pack, then you will also need to place the following file (from the original CD)...
a883fef0fd10aadeb73d34c462ff865d pak000.pk4
...in the following folder:
/usr/local/games/doom3/d3xp
BONUS: Some extra information regarding *.pk4 files
Setting up the original Doom3 patch data
In addition to the previous files, some other extra *.pk4 files were later released by ID to fix some issues. You should also place these extra files together with the previous ones.
Extra Doom 3 (patch) files:
2afd4ece27d36393b7538d55a345b90d pak005.pk4 a6e7003fa9dcc75073dc02b56399b370 pak006.pk4 6319f086f930ec1618ab09b4c20c268c pak007.pk4 28750b7841de9453eb335bad6841a2a5 pak008.pk4
Extra Resurrection of Evil Expansion Pack (path) files:
06fc9be965e345587064056bf22236d2 pak001.pk4
This is how you obtain these extra files:
- Download this file from ID's ftp server: ftp://ftp.idsoftware.com/idstuff/doom3/linux/doom3-linux-1.3.1.1304.x86.run (md5sum: 6325f0936f59420d33668754032141cb)
- Execute it and answer the following questions:
- Do you agree with the license? [Y/n] --> Y
- Would you like to read the README file ? [Y/n] --> n
- Please enter the installation path [/usr/local/games/doom3] --> enter some OTHER empty folder (like "~/tmp_001")
- Please enter the path in which to create the symbolic links [/usr/local/bin] --> enter the same folder as in the previous question
- Option: 'PunkBuster client/server files' ? [Y/n] --> n
- Now just copy the "pak*.pk4" files we mentioned before (to the appropriate folder) and ignore (delete) all the others ("rm -rf ~/tmp_001").
Setting up the keys
The original source code includes a CD-KEY protection mechanism to avoid piracy. Even if it is trivial to remove this protection once the sources are available, we encourage you not to do so as a sign of respect for all the great work they do at ID Software. Just remember this: if we play nice, in a few years they will open source Rage's engine :). Please, buy the original game.
When you buy the original game you will receive a "key". Place it in the following file:
~/.doom3/base/doomkey
... or just enter it in the dialog that appears the first time you run the game and the engine will place the key in that file for you.
If you also have the Resurrection of Evil Expansion Pack, it will come with another (different) key that you should place in the following file:
~/.doom3/base/xpkey
Note that these files contain a single line with no dashes. Everything in uppercase.
Run
$ cd doom3.gpl $ ./doom.x86
Enjoy! :)