Tuesday, 3 January 2012

On compiling Doom3 source code

As you may know, idSoftware released the source code for Doom3 game under the GPL license. You can download it from here https://github.com/TTimo/doom3.gpl/downloads. This is the source code for their  id Tech 4 engine

The zip file is 9 megs,  55 megs unzipped.

You will need to have non-free (i.e. not Express) version of Visual Studio 2010 and also download and install DirectX SDK (550 megs, free) to compile the code.

For me it failed in Release configuration with the following errors:

7>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(574,5): error MSB6006: "mt.exe" exited with code 31.

5>sound\snd_system.cpp(167): error C2664: 'ALenum (ALubyte *)' : cannot convert parameter 1 from 'const char [16]' to 'ALubyte *'
5>sound\snd_system.cpp(167): error C2664: 'ALenum (ALubyte *)' : cannot convert parameter 1 from 'const char [16]' to 'ALubyte *'



mt.exe error: Google suggested that there could be missing > bracket in <Mt in

 "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets" - not in my case

The error was gone next time a hit Build on the solution. Weird.

ALenum errors: the fix was to add missing ID_ALCHAR directives on the following line in sound\snd_system.cpp file:

instead of:

#if ID_OPENAL
 common->Printf( "%8d kB total OpenAL audio memory used\n", ( alGetInteger( alGetEnumValue( "AL_EAX_RAM_SIZE" ) ) - alGetInteger( alGetEnumValue( "AL_EAX_RAM_FREE" ) ) ) >> 10 );
#endif


do this:

#if ID_OPENAL
 common->Printf( "%8d kB total OpenAL audio memory used\n", ( alGetInteger( alGetEnumValue( ID_ALCHAR "AL_EAX_RAM_SIZE" ) ) - alGetInteger( alGetEnumValue( ID_ALCHAR "AL_EAX_RAM_FREE" ) ) ) >> 10 );
#endif

After these changes, I was able to compile it and it ended up with 204 megs in build\Win32\Release subfolder, among which there was DOOM3.exe.

Now I'm off to draw some textures and get that Radiant editor  or DarkRadiant which is supposed to be more suitable for Doom3 modding ... ;)

Update 1: How to use that built DOOM3.exe
  • Create the folder like C:\MyGames\Doom3
  • Place doom3.exe in the above folder
  • Copy base folder from the source code into the above
  • Copy compiled gamex86.dll into base folder
  • Run the command line below in base folder to create initial folders layout
  • Run doom3.exe - it will start and then stop with error "_default material not found" - I'm off to investigate it now


md af
md dds
md def
md demos
md efxs
md env
md fonts
md fx
md glprogs
md guis
md lights
md maps
md materials
md models
md newpdas
md particles
md script
md skins
md sound
md strings
md textures
md ui
md video











1 comment: