Mission Filestructure

From The DarkMod Wiki
Jump to: navigation, search

This page lists the internal structure of TDM's mission .pk4 files, including file naming conventions, so that all files and folders are correctly packed.

There are also external links to further reading and useful files (eg, .roq video encoder).

Mission.pk4 filenaming

It is important to come up with a unique filename for your mission's PK4 file, as the filename is used by the in-game mission manager to distinguish the packages: it is best to choose a .pk4 name that has not been used by other released missions.

Furthermore, do not use international characters or symbols for the filename. Alphanumeric only (A-Z, a-z and 0-9).

Symbol _ (underscore) may be used if necessary, however be aware that using - (dash) or & (ampersand) will cause assets in def files to not load and will break your mission.

Please do not include version information in the filename (this is why there is a readme). Future updates must have the same filename to properly update via the in-game installer.

Mission .pk4's

  • This is your mission file, containing everything required to play your mission.
  • All TDM missions must be packaged in a .pk4 file (a renamed .zip archive).
  • The contents of the PK4 resemble the folder structure as found in the main ../darkmod/ directory (eg, textures go into ../textures/, .def files go to ../def/).
  • The PK4 contains all the files needed to run the mission, and must comprise the minimum content, as below.

Required content of a .pk4

In order for the FM to be correctly installed and played, a .pk4 archive needs to contain, at minimum, the compiled maps (dmap output) and two text files:


The above example list of files is based on a mission called 'levelname'.
All instances of 'levelname' in the .pk4 must be renamed accordingly.

The two text files are needed to display your mission in the "New Mission" dialog of TDM's main menu, as described in the Startpack Mapper's Guide.

Internal Structure of a .pk4

What follows is an alphabetical list of all files and folders that might be found in an FM's .pk4, along with some description and with links to relevant internal wiki pages.

There are some links to external sites that might be of use or contain downloads for software required to create any custom or additional files (fonts, videos) for an FM.

If any associated external link is dead (especially to game-specific tools such as .roq encoder or font converter) - please report in the forum so that it might be updated.

It is assumed that ../ is the root of your archive (ie, "levelname.pk4") and all directory and file listing branches from this.

While certain folders may be used for other purposes, for organisation and ease of reference - maintaining the standard directory structure, working methodically, allows for easier internal reference and location of assets.

Text files

Credit given where it is due.
Mission title / pre-briefing intro, displayed on main menu (~50 words max).
This list.
A readme file, that someone might read.
Contains the name of your map (as described in Startpack Mapper's Guide).


These folders contain texture maps for use in the mission. TDM has some particular requirements for including custom .dds, that can be found on the .dds creation guidline page.

There is no stated optimal resolution for textures. 512x512 appears decent for most tiling or repeating patterns.

../dds/textures/darkmod/decals/custom decal.dds


Entity definitions are predefined spawnargs, used in the creation of, eg, custom loot. A more complete list of values to use might be found here.

Please remember that using - (dash) or & (ampersand) in the directory structure will cause your mission to break when the .def's are loaded by the game.



This folder serves to contain the environment for any custom skybox other than the default prefab.

Contains the custom skybox.
The tutorial for creating which can be found here.


In the case that a custom font is to be used, <size> is in points (eg <24>), the .dat file is created from a standard .ttf zip archive renamed to .dat.
There is further reading and a font creation tool for Doom3 engine here: https://web.archive.org/web/20080705204959/http://www.q3f.com/q3font.html
It is still unclear how the .dds for fonts are packaged, or if they are even required for custom fonts.


This one will require a few links to wiki pages that req. clarification.

/guis/custom_readable_slab.gui                                  //guis for readables
/guis/mainmenu_briefing.gui                                      //briefing screen. Can find extended version by Sotha via fidcal's (http://www.fidcal.com/DarkModContributions/guis/briefings/briefing_button.zip )
/guis/mainmenu_custom_defs.gui                                 //shop / [item] persistence over campaign / advanced briefing & debrief, eg, start points / replacement/music[voiceover] / video (wiki documentation).
/guis/assets/briefingX.tga                                          //briefing background
/guis/assets/generic_loading_bar1.tga                              //level load bar
/guis/assets/levelname_loading.tga                                  //loading background
/guis/assets/next_arrow.tga                                      //briefing arrows (as referred by briefing.gui)
/guis/assets/game_maps/map_of_levelname.tga                              //in-game level map
/guis/assets/game_maps/map_of_levelname_icon.tga                          //icon for level map
/guis/hudcustom_hud.tga                                  //hud changes (gui overlays scripting, not well explained, requires outside resource and familiarity with gui function)
/guis/hud/custom_inv_item.tga                          //extra inventory icons
/guis/map/levelname.gui                                 // custom loading screen, loading tips, changes to windowdef of any TDM gui


/splash/levelname_loading.tga                              //what it says - think the image dimensions either 640x480 or 512x512, origin is top left corner


ingame map

/map/map_of_levelname.gui                                  //points from game to tga (unsure if can tga can be compressed to dds for smaller d/l)


/lights/custom_light_colour.tga                                  //light shaders


as stated in preamble

/maps/levelname.aas_rat                                          //dmap output (richard gere and lemmiwinks).

/maps/levelname.aas32 //required to play game



so many different - many wiki pages to link. Perhaps best to use general definition.

/materials/custom_ai.mtr                                              //material files for several
/materials/custom_light.mtr                                         //purposes, definition to include
/materials/custom_map.mtr                                             //new textures, light, game map,
/materials/custom_obj_lod.mtr                                         //models, fixes, behaviour, etc...
/materials/levelname (new textures.surfaces).mtr
/materials/levelname_textures (modified textures).mtr
/materials/stolen_AI_base_WS1ghost.mtr                         // I nicked this one as example of custom.mtr
/materials/models/darkmod/decorative                                            //3DSMax / Blender / DR exported .ase files here
/materials/models/darkmod/category                                        //all ase requires definition through material (.mtr) and parent to (.skin).
/materials/models/darkmod/loot/custom loot model.ase  
/materials/models/darkmod/misc/system/skybox_model.lwo                             //lightwave model/mesh - references texture where? (unclear pointer) - 2D or 3D as with source vtf but to lwo instead? https://developer.valvesoftware.com/wiki/Skybox_(2D) / https://developer.valvesoftware.com/wiki/Making_3D_Skyboxes

this is out of sequence and without parent directory - needs double-check. These are materials/models/darkmod


possible child directory of materials that has lost structure in copy-pasta...



not getting into modelling - forums.

/md5                                                    //md5 mesh depot


link to particles

/particles/customparticle.prt                                      //particle info - can be created
/particles/tdm_alter_existing_particle.prt                          //using in-game console


link to scripts

/script/custom_ai.script                                          //script files here


Skins are required to link textures to .ase models (placed in ../materials or ../md5), and also require material definition (../def). The creation of a .skin file and process of application in DR through the entity inspector can be found here.

skins tutorial is bookmarked for clear-up

Process is similar to Quake: http://www.misfitcode.com/misfitmodel3d/olh_quakemd3.html#textures

../skins/texture for model.skin


link to sound shader article

/sound //sound shader replacement pointers

/sound/effects/                                                //the sound files themselves


link to #str article

/strings/fm                                                     //each translation requires new                            
/strings/fm/de.lang                                              //repack. Game items must be named
/strings/fm/eng.lang                                             //#str or look-up-replaced using...
/strings/fm/es.lang                                             //i forgot the name...
/strings/fm/pyc.lang                                           //ebatc


alternative to dds for non-alpha, simple texture

/textures/darkmod/                                                //new textures go here.
/textures/darkmod/custom texture.jpg                                     //normals and other maps must
/textures/darkmod/custom texture.tga  
/textures/darkmod/weapons/sword01.tga                                //be packaged as .dds - unclear on optimal dimension or resolutions (512x512 appears fine for tiling surface).
/textures/decals/blood                                             //alpha channel. 24 or 32bit only - appears black / loses alpha transparency if not.
/textures/decals/blood/custom_blood.jpg                       // jpegs do not contain alpha channels, but appears to retain EXIF - possible intrusion risk via stegosploit [untested].
/textures/decals/blood/custom_blood.tga                       // even if game does not allow for intrusion, JS or other access of file may run, RAT, embedded.
/textures/decals/dirt/dirt/custom_dirt.jpg                          // malicious level design: https://conference.hitb.org/hitbsecconf2015ams/wp-content/uploads/2015/02/D1T1-Saumil-Shah-Stegosploit-Hacking-with-Pictures.pdf
/textures/decals/dirt/custom_dirt.tga                          // considering older engine, perhaps worth test for guard in VM.


alternate custom places



/video/levelname_briefing.roq //format for in-game video (encoder: ftp://ftp.idsoftware.com/idstuff/quake3/tools/roq.zip / decoder: https://github.com/i...client/cl_cin.c)


xdata =

/xdata/briefing.xd                                             //text only briefing - use gui for moving image, timed sequence, etc...
/xdata/levelname.xd                                              //readables data

the end