GoldSrc/SteamPipe directories

Since the 2013 SteamPipe update, GoldSrc engine games and mods use a new directory structure for content loading and downloading.
This new structure is meant to make content management more secure and protects against malicious file downloads affecting the local user's game installation.
Previously, a server would download content to a user's game or mod directory, which could be used to affect files that are part of the game or mod's default installation.
It could also be used to alter configuration files if the user manually installed content that contains configuration files.
=Directory layout=
SteamPipe directories are added starting in "steamapps/common". Each directory consists out of one or more of the following components:
* : The base game directory. For Valve games, this is .
* : The game directory. By default, this is (Half-Life), unless the command line argument is provided, in which case it uses the directory specified by that argument.
* : The mod directory. This also applies to Valve games. This is affected by the command line argument. If that argument is not provided, the directory used for <game> is used instead.
* : The current game language.
* : The fallback directory.
* : The directory located in the base directory.
As of this writing, the only game that uses a different and is . It uses for , and for . Other games such as , and , and many others also uses different and .
The game will search for files by searching through each search path in the order that they are added. This means that for example the directory is only accessed if none of the other game directories contain the file.
In addition, game configuration files are only loaded from the search path, which prevents malicious servers and addon content from affecting game configuration and operation.
The following directories are added by the engine in the order that they are listed.
====
If low violence is enabled, this directory is added to override violent content.
Read only.
Added to the search path ID.
====
If the command line argument is specified, or the "Allow custom addon content" checkbox is enabled in Options ► Video (saved in the registry as ), this directory is added to enable addon content.
This is the preferred installation directory for addon content such as map packs, models, sounds, etc...
Read only.
Added to the search path ID.
====
If a language other than English is set for this game, this directory is added to provide content specific to that language, such as translated files.
Read only.
Added to the search path ID.
If the command line argument is not specified, and the command line specified as part of the first command line argument (normally automatically provided by the operating system), an additional directory is provided.
====
If the command line argument is not provided and the "Enable HD models if available" checkbox is enabled in (saved in the registry as ), this directory is added to override models with high definition versions.
Read only.
Added to the search path ID.
====
The mod directory. Always added.
Writable.
Added to the and search path IDs.
====
The downloads directory. Always added.
Writable.
Added to the search path ID.
==Fallback directories==
A mod may specify a fallback directory in to add directories from another mod to its own.
All of the above directories are added, with the exception of the directory. All directories are added to the search path ID only.
The directories are added as writable directories.
If the mod is not <game>, a localization file located in will be loaded for use with VGUI2.
==Language support==
When a language other than English is being used, the English directories for low violence, addon and localization for <game> are also added to the search path ID.
==Default directories==
There are a number of directories that are also added to fall back default game content and to access files common to all mods.
* The HD directory for <game> is always added if HD models are enabled. It is added to the search path ID.
* The <base> directory is added to the search path ID.
* The mod directory for <game> is added to the search path ID.
* The <platform> directory is added to the search path ID.
=Notes=
The console commands and will cause the filesystem's search paths to be reset. If you have made any changes in your own mod, these will be removed.
Both commands are booleans, and set whether HD models or addon content are to be used, respectively.
=See also=
* SteamPipe
* IFileSystemV009
Category:GoldSrc
Category:Files