The Dark Mod - Compilation Guide: Difference between revisions
New page: This guide should provide you with enough information to compile The Dark Mod's game code from source. The sources are available through "snapshots", i.e. whenever the Dark Mod team is r... |
No edit summary |
||
Line 3: | Line 3: | ||
The sources are available through "snapshots", i.e. whenever the Dark Mod team is releasing a new update (e.g. TDM 1.01) the corresponding sources are released as well. | The sources are available through "snapshots", i.e. whenever the Dark Mod team is releasing a new update (e.g. TDM 1.01) the corresponding sources are released as well. | ||
Right | == Download the sources == | ||
You can download the latest source package from our website: http://www.thedarkmod.com/download_source.php | |||
== Windows == | |||
For Windows you'll need Visual Studio to compile the project, you can get the free Express editions from the Microsoft website. It should work with every version starting from VC++ 2005 upwards, although I'd recommend the VC++ 2008 one. If you go for the older VC++ 2005, you'll need the Platform SDK as well, which is another large download. You don't need a Platform SDK for VC++ 2008. | |||
Download the sources and unpack them somewhere. You'll find a <tt>d3game.sln</tt> solution file (which is in VC++ 2005 format), which you can double-click to open in Visual Studio. The newer VC++ 2008 will present you an upgrade wizard to convert the solution to 2008. | |||
Once opened, select the Configuration Type in the topmost toolbar (either "release" or "debug", depending on what you want to do) and hit "Build Solution" ({{Ctrl}}-{{Shift}}-{{key|B}}). The compilation usually takes a few minutes, watch the output window at the bottom of Visual Studio. Once completed, you'll find the compiled <tt>gamex86.dll</tt> in a subfolder named "releasedll" (for release builds" or "debugdll" (for debug builds). | |||
In order to "install" the gamex86.dll, you need to copy it somewhere where Doom3.exe can find it. There are two ways to do that: either you place the dll right next to your DOOM3.exe which will override any other mechanism (the game will always load the DLL right next to DOOM3.exe ''first''), or you put them in a PK4 (along with a binary.conf file) and place it in your mod folder. There is some info on www.iddevnet.com/doom3 about how to do that. | |||
=== Debugging the Game === | |||
To debug your custom built game code, you need to attach Visual Studio's debugger to the Doom3.exe process. There are two ways to accomplish that: | |||
The quick one: | |||
# Go to Visual Studio and open the d3game solution | |||
# Start the game (either through tdmlauncher.exe or through DOOM3.exe plus command lines) | |||
# Once the game is up and running, Alt-Tab back to Visual Studio | |||
# Go to menu "Debug" > "Attach to Process..." and select the DOOM3.exe process from the list in that dialog popping up. | |||
# The debugger will now attach to Doom3 (along with all loaded DLLs) and you can now place breakpoints or intercept game crashes. | |||
The longer one (if you debug your game more than once or twice): | |||
# Go to Visual Studio and open the d3game solution | |||
# Right-click the Solution in the "Solution Explorer" and select "Add" > "Existing Project..." | |||
# Browse to DOOM3.exe and select that, you'll see the DOOM3.exe project added to your solution explorer view. | |||
# Right-Click the DOOM3.exe and choose "Select as startup project". | |||
# Now you can start the debugger just by hitting F5 and Visual Studio will automatically attach to the Doom3 process. | |||
# [Optional]: You can specify command line parameters to Doom3.exe by opening the Doom3.exe project properties and adding the desired parameters (e.g. com_allowConsole or fs_game_base/fs_game) to the "Command Arguments" item. This is necessary if you want to debug a specific TDM mission (although in this case, employing the "quick" method above is easier). | |||
Note: you can still attach your debugger to any running DOOM3.exe process with the second method. | |||
=== Troubleshooting === | |||
== Linux == | |||
For Linux you'll need gcc and scons, plus a few packages depending on your distribution. There is a README.linux file contained in the source package you downloaded, check it out for some details. | |||
== Test the Module == | |||
Note: this page is obviously WIP. | |||
[[Category:Tutorial]] | [[Category:Tutorial]] | ||
[[Category:Coding]] | [[Category:Coding]] |
Revision as of 06:59, 29 October 2009
This guide should provide you with enough information to compile The Dark Mod's game code from source.
The sources are available through "snapshots", i.e. whenever the Dark Mod team is releasing a new update (e.g. TDM 1.01) the corresponding sources are released as well.
Download the sources
You can download the latest source package from our website: http://www.thedarkmod.com/download_source.php
Windows
For Windows you'll need Visual Studio to compile the project, you can get the free Express editions from the Microsoft website. It should work with every version starting from VC++ 2005 upwards, although I'd recommend the VC++ 2008 one. If you go for the older VC++ 2005, you'll need the Platform SDK as well, which is another large download. You don't need a Platform SDK for VC++ 2008.
Download the sources and unpack them somewhere. You'll find a d3game.sln solution file (which is in VC++ 2005 format), which you can double-click to open in Visual Studio. The newer VC++ 2008 will present you an upgrade wizard to convert the solution to 2008.
Once opened, select the Configuration Type in the topmost toolbar (either "release" or "debug", depending on what you want to do) and hit "Build Solution" (Ctrl-Shift-B). The compilation usually takes a few minutes, watch the output window at the bottom of Visual Studio. Once completed, you'll find the compiled gamex86.dll in a subfolder named "releasedll" (for release builds" or "debugdll" (for debug builds).
In order to "install" the gamex86.dll, you need to copy it somewhere where Doom3.exe can find it. There are two ways to do that: either you place the dll right next to your DOOM3.exe which will override any other mechanism (the game will always load the DLL right next to DOOM3.exe first), or you put them in a PK4 (along with a binary.conf file) and place it in your mod folder. There is some info on www.iddevnet.com/doom3 about how to do that.
Debugging the Game
To debug your custom built game code, you need to attach Visual Studio's debugger to the Doom3.exe process. There are two ways to accomplish that:
The quick one:
- Go to Visual Studio and open the d3game solution
- Start the game (either through tdmlauncher.exe or through DOOM3.exe plus command lines)
- Once the game is up and running, Alt-Tab back to Visual Studio
- Go to menu "Debug" > "Attach to Process..." and select the DOOM3.exe process from the list in that dialog popping up.
- The debugger will now attach to Doom3 (along with all loaded DLLs) and you can now place breakpoints or intercept game crashes.
The longer one (if you debug your game more than once or twice):
- Go to Visual Studio and open the d3game solution
- Right-click the Solution in the "Solution Explorer" and select "Add" > "Existing Project..."
- Browse to DOOM3.exe and select that, you'll see the DOOM3.exe project added to your solution explorer view.
- Right-Click the DOOM3.exe and choose "Select as startup project".
- Now you can start the debugger just by hitting F5 and Visual Studio will automatically attach to the Doom3 process.
- [Optional]: You can specify command line parameters to Doom3.exe by opening the Doom3.exe project properties and adding the desired parameters (e.g. com_allowConsole or fs_game_base/fs_game) to the "Command Arguments" item. This is necessary if you want to debug a specific TDM mission (although in this case, employing the "quick" method above is easier).
Note: you can still attach your debugger to any running DOOM3.exe process with the second method.
Troubleshooting
Linux
For Linux you'll need gcc and scons, plus a few packages depending on your distribution. There is a README.linux file contained in the source package you downloaded, check it out for some details.
Test the Module
Note: this page is obviously WIP.