Source SDK Files and Directory Structure: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
 Note:Since SteamPipe update in 2013, the
Note:Since SteamPipe update in 2013, the 
 
Compiling a 
Creating a texture for 
Creating a model for 
		
	
| GamerDude27 (talk | contribs)  m (Cleanup) | |||
| (18 intermediate revisions by 9 users not shown) | |||
| Line 1: | Line 1: | ||
| {{ | {{LanguageBar}} | ||
| {{Source topicon}} | |||
| | | With the release of {{Src13|4}}, the default directory structure was changed to remove the restriction of having to save your game content into the {{path|/sourcesdk}} directory tree. This document explains how the [[Source SDK]] directory structure is set up. | ||
| | | |||
| }} | |||
| == The Directory Structure Explained == | |||
| == The  | |||
| The SDK directory structure is now set up so that game content directories are separated from game sources directories. | The SDK directory structure is now set up so that game content directories are separated from game sources directories. | ||
| * '''Game content''' files are the actual files necessary to run the game  | * '''Game content''' files are the actual files necessary to run the game textures, maps, models, etc. | ||
| * '''Game sources''' are the files that are used to create that game content (the "source" of the game content). | * '''Game sources''' are the files that are used to create that game content (the "source" of the game content). | ||
| This table explains some of the different game content and game source file types in the SDK: | This table explains some of the different game content and game source file types in the SDK: | ||
| {{note|Since SteamPipe update in 2013, the {{path|username}} (tied to Steam account name) folder has been renamed to {{path|common}} folder.}} | |||
| {| class=standard-table | {| class=standard-table | ||
| ! File type         || Description           || Location | ! File type         || Description           || Location | ||
| |- | |- | ||
| | <code>.[[VMF]]</code>  | | <code>.[[VMF (Valve Map Format)|vmf]]</code>         || Map source files.           || <code>sourcesdk_content\<game name>\mapsrc</code></br>{{code|<game name>\sdk_content\mapsrc}} ({{l4dbranch|1}} and later) | ||
| |- | |- | ||
| |<code>. | | <code>.[[TGA|tga]] .[[TXT|txt]]</code>         || Texture source files.           || <code>sourcesdk_content\<game name>\materialsrc</code></br>{{code|<game name>\sdk_content\materialsrc}} ({{l4dbranch|1}} and later) | ||
| | | |||
| |Texture source files. | |||
| |<code>sourcesdk_content\<game name>\materialsrc</code> | |||
| |- | |- | ||
| |<code>.[[SCN]] .[[SMD]] .[[QC]]</code>  | | <code>.[[SCN|scn]] .[[SMD|smd]] .[[QC|qc]]</code>         || Model source files.           || <code>sourcesdk_content\<game name>\modelsrc</code></br>{{code|<game name>\sdk_content\modelsrc}} ({{l4dbranch|1}} and later) | ||
| |- | |- | ||
| | <code>.[[BSP]] | | <code>.[[BSP|bsp]]         || Map content files—compiled game maps.           || <code><game name>\maps</code> | ||
| |- | |- | ||
| |<code>.[[MDL]] .[[VTX]]</code>  | | <code>.[[MDL|mdl]] .[[VTX|vtx]]</code>         || Model content files—compiled game models.           || <code><game name>\models</code> | ||
| |- | |- | ||
| | <code>.[[VMT]] .[[VTF]]</code>         || Texture content  | | <code>.[[VMT|vmt]] .[[VTF|vtf]]</code>         || Texture content files—compiled model skins.           || <code><game name>\materials\models</code> | ||
| |- | |- | ||
| | <code>.[[VMT]] .[[VTF]]</code>         || Texture content  | | <code>.[[VMT|vmt]] .[[VTF|vtf]]</code>         || Texture content files—compiled brush textures.           || <code><game name>\materials</code> | ||
| |} | |} | ||
| The following image shows the default locations for these files and folders: | The following image shows the default locations for these files and folders: | ||
| [[ | [[File:developer-contentfolders.jpg]] | ||
| {| class=standard-table | {| class=standard-table | ||
| | '''Steam Install Directory'''      || The location where you've installed Steam. | | '''Steam Install Directory'''      || The location where you've installed Steam. | ||
| |- | |- | ||
| | '''Game Content'''                 || The game content is here, with all the files necessary to run each game under each game directory. | | '''Game Content'''                 || The game content is here, with all the files necessary to run each game under each game directory. <br>Games run on {{src13|4}} and {{l4d|since}} (Authoring Tools) will have it's SDK installed in the same location as the game itself. | ||
| |- | |- | ||
| | '''SDK Tools'''                    || The location of the applications necessary to create and compile SDK content. | | '''SDK Tools'''                    || The location of the applications necessary to create and compile SDK content. The tools only works with {{src09|4}} and earlier. | ||
| |- | |- | ||
| | '''Content Sources'''             || Directories for each of the types of game content sources are here, with a set of directories for each game you want to create content for. '''SDK sample content is also stored here.''' | | '''Content Sources'''             || Directories for each of the types of game content sources are here, with a set of directories for each game you want to create content for. '''SDK sample content is also stored here.'''</br>These are moved to {{code|SourceSDK\sourcesdk_content}} and {{code|depot_211_dir.vpk\sourcesdk_content}} after SteamPipe.</br>SDK sample content in Left 4 Dead (and later branches), some Source games are located in {{code|<game name>\sdk_content}}. | ||
| |} | |} | ||
| == Examples of  | == Examples of Using This SDK Directory Structure == | ||
| Here are some practical examples of how this structure is used: | Here are some practical examples of how this structure is used: | ||
| === Compiling a {{Css|2}} map === | |||
| === Compiling a  | |||
| # Launch the [[Hammer]] map editor from the '''SDK Tools Directory'''. | # Launch the [[Hammer]] map editor from the '''SDK Tools Directory'''. | ||
| # Save the map as a [[VMF]] into the <code>cstrike\mapsrc</code> directory, which is under '''Content Sources'''. | # Save the map as a [[VMF]] into the <code>cstrike\mapsrc</code> directory, which is under '''Content Sources'''. | ||
| # Compile the map inside Hammer. The map is compiled as a [[BSP]] and automatically placed in the <code>cstrike\maps</code> '''Game Content''' directory. | # Compile the map inside Hammer. The map is compiled as a [[BSP]] and automatically placed in the <code>cstrike\maps</code> '''Game Content''' directory. | ||
| === Creating a texture for  | === Creating a texture for {{Hl2dm|2}} === | ||
| # Create a texture in an [[image editor]], and save it as a [[TGA]] in the <code>hl2mp\materialsrc</code> directory, which is under '''Content Sources'''. | # Create a texture in an [[image editor]], and save it as a [[TGA]] in the <code>hl2mp\materialsrc</code> directory, which is under '''Content Sources'''. | ||
| # Compile the texture with [[ | # Compile the texture with <code>[[VTEX (Valve Texture Tool)|vtex.exe]]</code>, which is in the '''SDK Tools Directory'''. | ||
| # The texture is compiled as a [[VTF]] file and automatically placed in the <code>hl2mp\materials</code> '''Game Content''' directory. | # The texture is compiled as a [[VTF]] file and automatically placed in the <code>hl2mp\materials</code> '''Game Content''' directory. | ||
| # Create the [[VMT]] material file with a [[text editor]], and save it in the <code>hl2mp\materials</code> '''Game Content''' directory. | # Create the [[VMT]] material file with a [[text editor]], and save it in the <code>hl2mp\materials</code> '''Game Content''' directory. | ||
| === Creating a model for  | === Creating a model for {{Hl2|2}} === | ||
| # Create an [[SCN]] model in [[ | # Create an [[SCN]] model in [[Softimage Mod Tool|XSI EXP]], and export it as an [[SMD]] in the <code>hl2\modelsrc</code> directory, which is under '''Content Sources'''. | ||
| # Create the .QC model definition file with a [[text editor]], and save it in the <code>hl2\modelsrc</code> directory, which is under '''Content Sources'''. | # Create the .QC model definition file with a [[text editor]], and save it in the <code>hl2\modelsrc</code> directory, which is under '''Content Sources'''. | ||
| # Compile the model with [[ | # Compile the model with <code>[[Studiomodel|Studiomdl.exe]]</code>, which is in the '''SDK Tools''' Directory. | ||
| # The model is compiled as a [[MDL]] and automatically placed in the <code>hl2\models</code> '''Game Content''' directory. | # The model is compiled as a [[MDL]] and automatically placed in the <code>hl2\models</code> '''Game Content''' directory. | ||
| For in-depth descriptions of these procedures, see the appropriate section of the Source SDK Documentation. | For in-depth descriptions of these procedures, see the appropriate section of the Source SDK Documentation. | ||
| [[Category: | [[Category:Files]] | ||
| [[Category:Source SDK FAQ]] | |||
Latest revision as of 15:17, 17 October 2025
With the release of  Source 2013, the default directory structure was changed to remove the restriction of having to save your game content into the
 Source 2013, the default directory structure was changed to remove the restriction of having to save your game content into the 
/sourcesdk directory tree. This document explains how the Source SDK directory structure is set up.
The Directory Structure Explained
The SDK directory structure is now set up so that game content directories are separated from game sources directories.
- Game content files are the actual files necessary to run the game textures, maps, models, etc.
- Game sources are the files that are used to create that game content (the "source" of the game content).
This table explains some of the different game content and game source file types in the SDK:
 Note:Since SteamPipe update in 2013, the
Note:Since SteamPipe update in 2013, the 
username (tied to Steam account name) folder has been renamed to 
common folder.| File type | Description | Location | 
|---|---|---|
| .vmf | Map source files. | sourcesdk_content\<game name>\mapsrc<game name>\sdk_content\mapsrc(Left 4 Dead engine branch and later) | 
| .tga .txt | Texture source files. | sourcesdk_content\<game name>\materialsrc<game name>\sdk_content\materialsrc(Left 4 Dead engine branch and later) | 
| .scn .smd .qc | Model source files. | sourcesdk_content\<game name>\modelsrc<game name>\sdk_content\modelsrc(Left 4 Dead engine branch and later) | 
| .bsp | Map content files—compiled game maps. | <game name>\maps | 
| .mdl .vtx | Model content files—compiled game models. | <game name>\models | 
| .vmt .vtf | Texture content files—compiled model skins. | <game name>\materials\models | 
| .vmt .vtf | Texture content files—compiled brush textures. | <game name>\materials | 
The following image shows the default locations for these files and folders:
| Steam Install Directory | The location where you've installed Steam. | 
| Game Content | The game content is here, with all the files necessary to run each game under each game directory. Games run on  Source 2013 and (in all games since  ) (Authoring Tools) will have it's SDK installed in the same location as the game itself. | 
| SDK Tools | The location of the applications necessary to create and compile SDK content. The tools only works with  Source 2009 and earlier. | 
| Content Sources | Directories for each of the types of game content sources are here, with a set of directories for each game you want to create content for. SDK sample content is also stored here. These are moved to SourceSDK\sourcesdk_contentanddepot_211_dir.vpk\sourcesdk_contentafter SteamPipe.SDK sample content in Left 4 Dead (and later branches), some Source games are located in <game name>\sdk_content. | 
Examples of Using This SDK Directory Structure
Here are some practical examples of how this structure is used:
Compiling a  Counter-Strike: Source map
 Counter-Strike: Source map
- Launch the Hammer map editor from the SDK Tools Directory.
- Save the map as a VMF into the cstrike\mapsrcdirectory, which is under Content Sources.
- Compile the map inside Hammer. The map is compiled as a BSP and automatically placed in the cstrike\mapsGame Content directory.
Creating a texture for  Half-Life 2: Deathmatch
 Half-Life 2: Deathmatch
- Create a texture in an image editor, and save it as a TGA in the hl2mp\materialsrcdirectory, which is under Content Sources.
- Compile the texture with vtex.exe, which is in the SDK Tools Directory.
- The texture is compiled as a VTF file and automatically placed in the hl2mp\materialsGame Content directory.
- Create the VMT material file with a text editor, and save it in the hl2mp\materialsGame Content directory.
Creating a model for  Half-Life 2
 Half-Life 2
- Create an SCN model in XSI EXP, and export it as an SMD in the hl2\modelsrcdirectory, which is under Content Sources.
- Create the .QC model definition file with a text editor, and save it in the hl2\modelsrcdirectory, which is under Content Sources.
- Compile the model with Studiomdl.exe, which is in the SDK Tools Directory.
- The model is compiled as a MDL and automatically placed in the hl2\modelsGame Content directory.
For in-depth descriptions of these procedures, see the appropriate section of the Source SDK Documentation.



























