-
Notifications
You must be signed in to change notification settings - Fork 18
File System Load Precedences
The general precedence order between categories from highest precedence to lowest (generally files/directories override and are searched before lower listed files/directories in this precedence list) is:
-
fs_game (current mod)
-
direct sourcetype files
- dynamic library
- qvm
-
pk3dir
- qvm
-
pk3
- qvm
-
direct sourcetype files
-
basemod
-
direct sourcetype files
- dynamic library
- qvm
-
pk3dir
- qvm
-
pk3
- qvm
-
direct sourcetype files
-
default content
-
engine version
- dynamic library
-
pk3
- qvm
-
engine version
-
versioned base folders
-
engine version
-
direct sourcetype files
- dynamic library
- qvm
-
pk3dir
- qvm
-
pk3
- qvm
-
direct sourcetype files
-
engine version
-
inactive mod folders
-
direct sourcetype files
- dynamic library
- qvm
-
pk3dir
- qvm
-
pk3
- qvm
-
direct sourcetype files
Precedence for pk3s that are not default content is based on the pk3s' names. Precedence for pk3 files that are default content have a custom precedence that is hard-coded. pk3dirs are treated the same as pk3 files, except in the case of a pk3dir having the same name as a pk3 file in the same precedence category, the pk3dir would take precedence.
direct sourcetype files are non-pk3 files. They have higher precedence over all other pk3 files and pk3dirs that are in the same precedence category as the direct sourcetype files
Generally dynamic libraries would override qvms in the same mod directory, if dynamic library loading is enabled.
These are the top folders in the homepath and/or in basepath that are none of the versioned base folders, not the basemod, and not the currently active fs_game (current mod). For pure and semipure servers, pk3 files in the inactive mod folders are only used if they match the allowed pk3 hashes and names. For unpure servers, any particular pk3 file in the inactive mod folders is only used if it contains a needed file not found anywhere else.
Engine version precedence is a precedence subcategory. The engine version of a pk3 file specifies the earliest version of Tremulous the pk3 is used in. Engine version precedence is used by the hardcoded default content and by the versioned base folders. The precedence order from highest to lowest (where higher precedence overrides and is searched before lower) is:
- X.Y: X and Y are non-negative integers. Larger values for X have higher precedence than lower values for X. If X was equal for two different versions, larger values for Y have higher precedence than lower values for Y.
- 1.3
- gpp: Special case naming convention for backwards compatibility. Has higher precedence than 1.1 but lower precedence than 1.3. gpp would technically have lower precedence than 1.2 if 1.2 was ever used.
- 1.1: Has lowest precedence.
The versioned base folders are located in the homepath and/or in the basepath. Each versioned base folder is associated with an Engine Version, and Engine Version Precedence applies between the different versioned base folders. versioned base folders with a higher engine version than the engine version of the current basegame, are not used. The associations of the specific versioned base folders with the corresponding engine version from highest to lowest precedence (where higher precedence overrides and is searched before lower)are as follows:
- base_X.Y: associated with version X.Y Where X.Y is a version after 1.3 (doesn't have to be consecutive).
- base_1.3: associated with version 1.3.
- gpp: associated with version gpp.
- base: associated with version 1.1.
The default content includes a "special" cgame dynamic library, a "special" ui dynamic library, and pk3 files that are specified as default content by a hard-coded hash list inside the client and tremded binaries. default content files can be located anywhere the binaries have access to load. While the client is either at the main menu or at the download menu, only the default content files and basemod files are loaded. The between default content files has its precedence hardcoded which includes being organized by engine version precedence, and can have special hardcoded precedence. default content files with a higher engine version than the engine version of the current basegame, are not used. Perhaps downloading from game servers pk3 files with the same names as the hardcoded default content files should not be allowed if it doesn't match the corresponding hardcoded hash(es).
The basemod folder is generally used for local base overrides. Like the the default content files, basemod files are used in the main menu in the download menu. Files can't be downloaded from game servers to the basemod folder even if it is located in the homepath. Generally only the fs_game has higher precedence than the basemod. (but what happens when the fs_game is set to a versioned base folder?)
The fs_game can be set to any top level sub-directory in the homepath and/or the basepath, including any of the versioned base folders, but excluding the basemod folder.
The write directory is the directory which the engine writes to, and is typically the homepath. The write directory has precedence over outside directories (like potentially the basepath which would include the installation files, however the basepath can be set to the same directory as the homepath) when files (either pk3 files or files outside of a pk3) have the exact same name. That way when the game writes a file like a config it can expect to read back the same file without a file in the other directory permanently overriding it. For other purposes in general the homepath and basepath are treated as if they were the same directory, whether or not they actually are.