Skip to content

Commit

Permalink
Clarify documentation of gamedirs, add to README.md
Browse files Browse the repository at this point in the history
Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
  • Loading branch information
bones-was-here committed Apr 1, 2024
1 parent 6068df0 commit b90beda
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,26 @@ Linux x86_64 builds are available in [GitHub CI](https://github.com/DarkPlacesEn
More complete builds are available in [xonotic.org](https://beta.xonotic.org/autobuild/) engine zips.
These support Windows, Linux and macOS, and include the current libraries needed for all features.

DarkPlaces supports many Quake-based games and you can select which it will run by renaming the executable so it's prefixed with the game's name, for example `rogue-sdl.exe`, or by passing a cmdline argument such as `-rogue`. The supported list and related details are defined in [com_game.c](https://github.com/DarkPlacesEngine/darkplaces/blob/master/com_game.c).
DarkPlaces supports many Quake-based games and you can select which it will run by renaming the executable so it's prefixed with the game's name, for example `rogue-sdl.exe`, or by passing a cmdline argument such as `-rogue`. This changes various engine behaviours and cvar defaults to suit the game. The supported list and related details are defined in [com_game.c](https://github.com/DarkPlacesEngine/darkplaces/blob/master/com_game.c).

Mods which aren't listed there can be run with (for example) `-game quake15` in which case DP will use the same behaviours and cvar defaults as for id1 Quake.

## Quake Virtual File System

All of Quake's data access is through a hierarchical file system, the contents
of the file system can be transparently merged from several sources.

The "base directory" is the path to the directory holding the quake.exe and
all game directories. The sys_* files pass this to host_init in
quakeparms_t->basedir. This can be overridden with the "-basedir" command
line parm to allow code debugging in a different directory. The base
directory is only used during filesystem initialization.

The "game directory" is the first tree on the search path and directory that
all generated files (savegames, screenshots, demos, config files) will be
saved to. This can be overridden with the "-game" command line parameter.
If multiple "-game <gamedir>" args are passed the last one is the "primary"
and files will be saved there, the rest are read-only.

## Build instructions (WIP)

Expand Down
9 changes: 4 additions & 5 deletions fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ static fs_offset_t WriteAll(const filedesc_t fd, const void *const buf, const si

/** \page fs File System
All of Quake's data access is through a hierchal file system, but the contents
All of Quake's data access is through a hierarchical file system, the contents
of the file system can be transparently merged from several sources.
The "base directory" is the path to the directory holding the quake.exe and
Expand All @@ -183,9 +183,8 @@ directory is only used during filesystem initialization.
The "game directory" is the first tree on the search path and directory that
all generated files (savegames, screenshots, demos, config files) will be
saved to. This can be overridden with the "-game" command line parameter.
The game directory can never be changed while quake is executing. This is a
precaution against having a malicious server instruct clients to write files
over areas they shouldn't.
If multiple "-game <gamedir>" args are passed the last one is the "primary"
and files will be saved there, the rest are read-only.
*/

Expand Down Expand Up @@ -2100,7 +2099,7 @@ void FS_Init_Commands(void)
Cvar_RegisterVariable (&fs_unload_dlcache);
Cvar_RegisterVariable (&cvar_fs_gamedir);

Cmd_AddCommand(CF_SHARED, "gamedir", FS_GameDir_f, "changes active gamedir list (can take multiple arguments), not including base directory (example usage: gamedir ctf)");
Cmd_AddCommand(CF_SHARED, "gamedir", FS_GameDir_f, "changes active gamedir list, can take multiple arguments which shouldn't include the base directory, the last gamedir is the \"primary\" and files will be saved there (example usage: gamedir ctf id1)");
Cmd_AddCommand(CF_SHARED, "fs_rescan", FS_Rescan_f, "rescans filesystem for new pack archives and any other changes");
Cmd_AddCommand(CF_SHARED, "path", FS_Path_f, "print searchpath (game directories and archives)");
Cmd_AddCommand(CF_SHARED, "dir", FS_Dir_f, "list files in searchpath matching an * filename pattern, one per line");
Expand Down

0 comments on commit b90beda

Please sign in to comment.