GoldSrc/SteamPipe directories

From Valve Developer Community
Jump to navigation Jump to search

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:

  • 🖿base: The base game directory. For Valve games, this is Half-Life.
  • 🖿game: The game directory. By default, this is valve (Half-Life), unless the -basedir command line argument is provided, in which case it uses the directory specified by that argument.
  • 🖿mod: The mod directory. This also applies to Valve games. This is affected by the -game command line argument. If that argument is not provided, the directory used for <game> is used instead.
  • 🖿language: The current game language.
  • 🖿fallback: The fallback directory.
  • 🖿platform: The platform directory located in the base directory.


As of this writing, the only game that uses a different <base> and <game> is Sven Co-op. It uses Sven Co-op for <base>, and svencoop for <game>. Other games such as Cry of Fear, Counter-Strike Online and Counter-Strike Nexon: Studio, and many others also uses different <base> and <game>.


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 _downloads directory is only accessed if none of the other game directories contain the file.

In addition, game configuration files are only loaded from the "GAMECONFIG" 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.

🖿<base>/<mod>_lv

If low violence is enabled, this directory is added to override violent content.

Read only.

Added to the "GAME" search path ID.

🖿<base>/<mod>_addon

Note.pngNote:Most modders are most likely still overlooked and ended up continuing installing mods in the old way, by replacing anything inside base game files,
which doesnt offer a easy way to remove it outside verifying game files. So it is highly recommended that you put all modded contents on this folder instead.

If the -addons command line argument is specified, or the "Allow custom addon content" checkbox is enabled in Options ► Video (saved in the registry as 🖿addons_folder), 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 "GAME" search path ID.

🖿<base>/<mod>_<language>

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 titles.txt files.

Read only.

Added to the "GAME" search path ID.

If the -steam command line argument is not specified, and the command line specified /game as part of the first command line argument (normally automatically provided by the operating system), an additional directory <base>/localization/<mod>_<language> is provided.

🖿<base>/<mod>_hd

If the -nohdmodels command line argument is not provided and the "Enable HD models if available" checkbox is enabled in Options->Video (saved in the registry as hdmodels), this directory is added to override models with high definition versions.

Read only.

Added to the "GAME" search path ID.

🖿<base>/<mod>

The mod directory. Always added.

Writable.

Added to the "GAME" and "GAMECONFIG" search path IDs.

🖿<base>/<mod>_downloads

The downloads directory. Always added.

Writable.

Added to the "GAMEDOWNLOAD" search path ID.

Fallback directories

A mod may specify a fallback directory in liblist.gam to add directories from another mod to its own. All of the above directories are added, with the exception of the _downloads directory. All directories are added to the "GAME_FALLBACK" search path ID only.

The _<language> directories are added as writable directories.

Note.pngNote: This is most likely a mistake.

If the mod is not <game>, a localization file located in Resource/<fallback>_<language>.txt 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 "DEFAULTGAME" 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 "DEFAULTGAME" search path ID.
  • The <base> directory is added to the "BASE" search path ID.
  • The mod directory for <game> is added to the "DEFAULTGAME" search path ID.
  • The <platform> directory is added to the "PLATFORM" search path ID.

Notes

The console commands _sethdmodels and _setaddons_folder 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