idTech editing hints & tips

Below is a list of essential editing hints and tips for idTech4 powered games (formally known as the 'Doom 3' engine); currently Quake Wars, Quake 4, Prey and Doom 3, but future idTech games may be support. For full list click here ».

[doom3.gpl] Change name of Doom3.exe

July 08, 2016, 06:50:03 PM by kat

The preferable way to change the name of the *.exe produced by compiling doom3.gpl is to modify the compiler output so it writes the name(space) correctly - changing the program executable or shortcut is possible but not the correct approach to use, neither is renaming any part of the project Visual Studio's Solution Explorer (in relation to naming the *.exe this does nothing, it only changes the name of the Solution project).

Changing the name of 'projects' in the Solution Explorer don't effect the name of the executable

To correctly change the exe name, in the Solution Explorer;

Step 1
  • Under "exes" right-click "DoomDLL" to open "DoomDLL Properties Pages".
  • Expand "Configuration Properties" (if not already expanded) and select "Debugging".
  • To the right of "Command" (not "Commend Arguments") click "$(OutDir)DOOM3.exe" to highlight for editing, replace "DOOM3" with the name of choice, e.g. "Catacombs" - string should read "$(OutDir)[custom name].exe", i.e. "$(OutDir)Catacombs.exe".
  • Click "Apply", then optionally if not continuing to 'Step 2', click "OK" to exit the Properties Page manage.

    Set "Configuration Properties » Debugging » Command" to rename the executable
Step 2
  • Expand "Configuration Properties" if not already visible, expand "Linker" then select "General".
  • To the right of "Output File" select "$(OutDir)DOOM3.exe" to highlight for editing, replace "DOOM3" with the name of choice, e.g. "Catacombs" - string should read "$(OutDir)[custom name].exe", i.e. "$(OutDir)Catacombs.exe".
  • Click "Apply", then "OK" to exit the Properties Page manage.

    Change "Linker" properties to reflect the name of the executable to be compiled
Other useful doom3.gpl topics
- Compiling doom3.gpl source code using Visual Studio
- Changing the Doom3.exe shortcut & program icon

[doom3.gpl] Change doom3.exe program/shorcut icon

July 08, 2016, 06:43:50 PM by kat

The doom3.gpl source code uses a standard 'icon' bitmap image to illustrate the compiled exe. To change this replace the respective 'icon' files, i.e. *.ico/Win, *.icns/OSx, *.png/Linux, in the following locations;

- For Windows: "\neo\sys\win32\rc\res", change "doom.ico" and/or "icon2.ico" (32bit, 32x32 pixel bitmap).
- For Mac: "\neo\sys\osx", change "Doom3.icns" (32bit, 128x128 pixel bitmap).
- For Linux: "\neo\sys\linux\setup\image", change "doom3.png" (32bit, 48x48 pixel PNG).

Images can be 24bit or 32 bit, the latter being required if the icon is to appear shaped or 'masked' in some way, a function that requires the use of image based alpha mask/channels, or where black (0,0,0) represents 0% opaque (100% transparent) pixels.

Other useful doom3.gpl topics
- Changing the name of DOOM3.exe (custom naming DOOM3.exe)
- Compiling the doom3.gpl source code with Visual Studio

[doom3.gpl] Compiling Doom 3/idtech 4 source code

July 08, 2016, 07:29:54 AM by kat

Instructions below relate to using Windows 7 to compile Doom3.gpl using Microsoft Visual Studio 2013 Community edition (not tested or checked on Windows 8/8.1 or Windows 10 - modified code as per below DOES NOT build with Visual Studio 2015). Code is extracted and used with minor modification (explained below).
(!) items required to produce a successful build.

How to install
The installation process for Visual Studio 2013 differs slightly to that of Visual Studio 2010 in that a number of components previously requiring separate download are now included by default during install (although still optional so need to be selected for inclusion), i.e. Microsoft Visual C++ library.
  • Install Visual Studio Community 2013, Multibyte MFC Library and the DirectX SDK to the suggested location(s) - typically "C:\Program Files (x86)\[path to install]" which allows the software to set up default system paths for reference within the project.
  • Create a separate project/development folder and in to it unpack/extract the contents of (this should be a completely separate folder/location to the Visual Studio 2013 installation files/directories, the location the eventual game/project is to be worked upon).
How to use
The source code likely won't compile without error by default but it shouldn't need any modification itself, all necessary changes are typically simple edits to the projects properties and settings.

Step 1: project update
The below loads the *.sln file into Visual Studio (may need to be opened from the application if more than one version of Visual Studio is available) and updates the data to be fully compatible with 2013.
  • Browse the 'doom3' project/development folder just created and find "\neo".
  • Double-click "doom.sln" (.solution file).
  • Visual Studio 2013 will open the project asking if it's OK to update to latest version. Click "Yes/Agree" (this is necessary for the files to be compiled with VS2013, without it build fails).

    When the *.sln project file opens in Visual Studio the program will want to update the selected files

    Files are displayed in the status bar as they are parsed and updated
Step 2: project properties
Setting up the projects environment, settings and properties. Once the project is loaded and updated, next;
  • In the Solution Explorer (panel on the right) right-click "Game" (under "dlls") and select "Properties" from the menu, then;

    - In "Configuration Properties" expand "C/C++" properties and left-click "Preprocessor".
    - To the right, click "Preprocessor Definitions" - currently displaying "DEBUG;%(PreprocessorDefinitions)".
    - Type "_XKEYCHECK_H;" between "DEBUG;" and "%(PreprocessorDefinitions)", i.e. "DEBUG;_XKEYCHECK_H;%(PreprocessorDefinitions)" (important note: "DEBUG;" may display as "_DEBUG;", "DEBUG;", "_NDEBUG;" or "NDEBUG;" et al if the project has been previously built and/or cleaned, or depending upon the build type selected [see below]).
    - Click "Apply" then "OK".

    The above prevents an "xkeyword.h" error causing a failed build - "324 error C1189: #error : The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to fine the forbidden macro".

  • Ensure Visual Studio 2013 lists the correct 'version' data in 'debug' settings, the "VC" (Visual C/C++) version used should be shown as "12" for Visual Studio 2013 (optional may not be required). To access, in the Solution Explorer right-click "Solution 'doom3' (7 projects)" and select "Properties" from the menu that appears. Expand "Common Properties" and select "Debug Source Files".

    Make sure the correct "VC" is listed, for 2013 it should be "12"
Step 3: modify snd_system.cpp
  • In the Solution Explorer, expand "DoomDLL", then "Sound". Double-click "snd_system.cpp" to edit and scroll down to line 167;

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

    And replace with the follow;

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

    Save the file. This prevents the following error in "snd_system.cpp" causing a failed build - "252 error C2664: 'ALenum (ALubyte *)' : cannot convert argument 1 from 'const char [16]' to 'ALubyte *'"
Step 4: Build
If the code is to be used as is without modifying anything, before compiling the 'build type' should be set to "Release" or "Dedicated Release" to ensure all the files and data are included in the appropriate *.exe, *.dll and other core files.
  • In the Solution Explorer right-click "Solution 'doom' (7 projects)", select "Configuration Manager...". In the properties window that appears select a compile option under "Active solution configuration:", i.e. "Release" or "Dedicated Release". Click "Close".

    The built type may need to be set to "Release" or "Dedicated Release"
  • To compile the source code right-click "Solution 'doom' (7 projects)" and select "Build Solution" - Visual Studio will build the project producing the necessary files (see below).
Successful compile
If successful a series of files are produced and saved to "build\Win32\Dedicated Release" in the project directory (where the source files were unpacked and the *.sln was double-clicked - note: a separate folder is created per build type within which output is saved). These are;
  • DOOM3.exe
  • Game.exp
  • Game.lib
  • gamex86.dll
  • idLib.lib
  • TypeInfo.exe
Once available copy to actual development folder (should contain folder/directory structure replicating that of Doom 3).

Other useful doom3.gpl topics
- Changing the name of DOOM3.exe (custom naming DOOM3.exe)
- Changing the Doom3.exe shortcut & program icon

Additional Information
The following information ostensibly pertains to using Visual Studio 2015 but may also be useful to Visual Studio 2013 in some situations.

Useful shortcut and mouse controls for GtkRadiant

February 14, 2016, 02:56:16 PM by kat

2D Grid Basics
Draw brush volume = LMB drag - draws a brush volume on the grid.
(De)Select a brush/object = Shift+LMB - selects/deselects objects.
Deselect all = Esc = deselects ALL items.
Move a selection = LMB drag active - active selections move based on grid view orientation.
Edit selection = LMB drag - click-drag the leading edge of a volume to increase/decrease size.
Cut/Clip selection = Ctrl+RMB - to place two or three 'clip points'; "Enter" to cut (Shift+Enter inverts cut).
Duplicate = Space Bar - duplicates a selection (alternative to Copy & Paste).
Strafe = RMB drag - moves view left/right, up/down.
Zoom = Shift+RMB drag - zooms the view in out relative to orientation.
Rotate = n/a - 2D grid does not rotate.
Change orientation = Ctrl+Tab - flips "Front" (XZ), "Side" (YZ) and "Top" (XY) orientation.

2D Grid Advanced
Select Group (single) = Alt+Shift+LMB - selects a func_group.
Select Group (multiple) = n/a (cf. 3D Camera Advanced)

3D Camera Basics
(De)Select (single) = Shift+LMB - selects/deselects individual items.
(De)Select (multiple) = Shift+LMB drag - selects/deselects multiple objects.
Rotate Camera = RMB drag - rotates around centre of view, "FPS look".
Rotate around object = Ctrl+RMB+Hold drag = hold down right mouse rotates around a central point (turntable style rotation).
Strafe Camera = Ctrl+RMB - right-click to engage then move mouse up/down, left/right (no click-hold).
Zoom Camera = MMB up/down - zooms Camera in/out (note camera doesn't actually zoom, it moves forwards/backwards along "X" axis).
Up = D - moves Camera UP "Z" axis.
Down = C - moves Camera DOWN "Z" axis.
Rotate Up = A - rotates Camera UP relative to view
Rotate Down = Z - rotates Camera DOWN relative to view.

3D Camera Advanced
(De)Select Group (single) = Alt+Shift+LMB - selects/deselects a func_group or other grouped item.
(De)Select Group (multiple) = Alt+Shift+LMB drag - selects/deselects multiple groups and objects in same action.
Paint Select (single) = Ctrl+Shift+LMB - selects single surface
Paint Select (multiple) = Ctrl+Shift+LMB drag - selects multiple surfaces in a single action.
Multi-Paint Select = Ctrl+Shift+Alt+LMB drag - make multiple passes at surface selection.
Assign texture to brush = Ctrl+MMB - assigns active texture to entire brush (all sides).
Assign texture to face = Shift+Ctrl+MMB - assigns active texture to individual brush face.

2D & 3D Advanced
Select 'type' = Shift+A - selects ALL of same object type or texture assignment.
Select (single) = Shift+LMB - selects single brush or object.
Select (multiple) = Shift+LMB drag - selects multiple objects in the same action.
Make Detail = Ctrl+M - flags brush volumes as "Detail" which are ignored during VIS calculations.
Toggle Detail = Ctrl+D - show/hides Detail flagged brush volumes.

Exporting *.bsp from 3DS Max

July 12, 2015, 05:43:45 PM by kat
Although 'volume' based levels can be made using 3DS Max, because the eventual format used needs to be specially compiled, it's not possible to export content from Max directly to *.bsp. BSP is a data structure rather than just a file-dump. This means the contents of a working file are analysed and broken down into a series of structures that are optimised in a way that removes some material. This isn't possible through a simple 'export' mechanism, so content has to exported to another format. However, it's not possible to simply export the contents of a Scene to a single model because the way those are handled in game would result in an unusable level (models are processes and culled based on bounding-box not surfaces). That being said models can still be used...

The general solution to exporting volume based content from 3DS Max is essentially two-fold;
  • use a *.map export script.
  • section the level and export a series of models.
If a *.map export script exists divide the level into simple 'convex' shapes and complex molded structures, i.e. flat walls, floors and other architectural features that describe the level versus statues, shaped fittings and features. Export the former group to *.map and the latter to a supported mesh format such as *.ase, *.obj etc. Both can then be opened in a level-editor like GtkRadiant and once rebuilt as the content was originally in Max, can then be properly compiled to BSP using a MAP2BSP compiler (dmap, q3map2 etc.).

An alternative to the above is to export content from Max to *.3ds which can then be opened and processed in Gmax before being compiled using the BSP compiler included with the Tempest Gamepack. This approach would typically mean rebuilding certain elements of the level and re-tagging content so the Tempest gamepack knows what to do with certain structures.

More information on working with models and volume based level design using a 3D application can be found on the tutorials page.