]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - README.md
sys: work around incomplete POSIX support in MacOS
[xonotic/darkplaces.git] / README.md
1 # DarkPlaces Engine
2
3 DarkPlaces is a game engine based on the Quake 1 engine by id Software. It
4 improves and builds upon the original 1996 engine by adding modern rendering
5 features, and expanding upon the engine's native game code language QuakeC, as
6 well as supporting additional map and model formats.
7
8 Developed by LadyHavoc. See [CREDITS](CREDITS.md) for a list of contributors.
9
10 ## Help/support
11
12 ### IRC
13 #darkplaces on irc.anynet.org
14
15 ### [Matrix](https://matrix.org/docs/guides/introduction)
16 [![#darkplaces:matrix.org](https://img.shields.io/matrix/darkplaces:matrix.org?color=660000&label=%23darkplaces%3Amatrix.org)](https://matrix.to/#/#darkplaces:matrix.org)
17
18 ## Downloading and running
19
20 Linux x86_64 builds are available in [GitHub CI](https://github.com/DarkPlacesEngine/darkplaces/actions?query=branch%3Amaster) artifacts.  
21
22 More complete builds are available in [xonotic.org](https://beta.xonotic.org/autobuild/) engine zips.  
23 These support Windows, Linux and macOS, and include the current libraries needed for all features.
24
25 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  
26 such as `-rogue`.  This changes various engine behaviours and cvar defaults to suit the game.  
27 The supported list and related details are defined in [com_game.c](https://github.com/DarkPlacesEngine/darkplaces/blob/master/com_game.c).
28
29 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.
30
31 ## Quake Virtual File System
32
33 All of Quake's data access is through a hierarchical file system, the contents
34 of the file system can be transparently merged from several sources.
35
36 The "base directory" is the path to the directory holding the quake.exe and
37 all game directories.  This can be overridden with the "-basedir" command
38 line parm to allow code debugging in a different directory.  The base
39 directory is only used during filesystem initialization.
40
41 The "game directory" is the first tree on the search path and directory that
42 all generated files (savegames, screenshots, demos, config files) will be
43 saved to.  This can be overridden with the "-game" command line parameter.
44 If multiple "-game <gamedir>" args are passed the last one is the "primary"
45 and files will be saved there, the rest are read-only.
46
47 ## Build instructions (WIP)
48
49 These instructions are adequate for Quake, but for Xonotic please refer to [its wiki](https://gitlab.com/xonotic/xonotic/-/wikis/Compiling).
50
51 ### Required packages
52
53 The minimum SDL version is 2.0.18 for Linux and 2.24.0 for Windows.  
54 The following package names are for Debian, see below for Windows and Mac.
55
56 ##### Client
57 Build (mandatory): `build-essential` `libjpeg-dev` `libsdl2-dev`  
58 Runtime (optional): `libcurl` `libpng` `libfreetype6` `libvorbisfile`  
59
60 ##### Dedicated Server
61 Build (mandatory): `build-essential` `libjpeg-dev` `zlib1g-dev`  
62 Runtime (optional): `libcurl` `libpng`  
63
64 ### Windows (MSYS2 MinGW):
65
66 1. Install MSYS2, found [here](https://www.msys2.org/).
67 2. Once you've installed MSYS2 and have fully updated it, open a MinGW64 terminal (***not an MSYS2 terminal***) and input the following command:
68
69 ```
70 pacman -S --needed gcc make mingw-w64-x86_64-{toolchain,libjpeg-turbo,libpng,libogg,libvorbis,SDL2}
71 ```
72
73 3. See [Unix instructions](#unix-(general)).
74
75 ### macOS
76 1. Open a terminal and input `xcode-select --install`
77 2. Install [Homebrew](https://brew.sh)
78 3. In the same (or a different terminal), input the following command:
79
80 ```
81 brew install sdl2 libjpeg-turbo libpng libvorbis curl
82 ```
83
84 4. See [Unix instructions](#unix-(general)).
85
86 ### Unix (General)
87
88 From a terminal, in the engine's root directory, input `make help` to list the targets.  
89 To build the main executable, input `make sdl-release` which creates the file called  
90 `darkplaces-sdl` or `darkplaces-sdl.exe` (Windows).
91
92 If you get errors (that don't seem to be about missing dependencies) try `make clean` before compiling, especially if you updated your system since the last time you compiled.
93
94
95 ### Windows (Visual Studio 2019)
96
97 Not recommended due to poor support for C standards, and lack of maintenance.
98
99 DarkPlaces requires C11, so Windows SDK 10.0.22000.0 (VS 2019) or 10.0.20348.0 (VS 2022) or later is needed.  
100 To install it, run the Visual Studio Installer, click "Modify", click "Individual components", select the latest Windows SDK version and de-select older versions.  
101 You will also need the NuGet Package Manager selected (to download SDL2 headers the first time you build).
102 Click "Modify" to apply the changes.  
103
104 VS 2019  
105 ![MSVC2019](msvc2019_C11.png)  
106
107 Open `darkplaces-vs2019.sln`, select build type "Debug" or "Release, and choose "Build Solution" from the "Build" menu to create the file `darkplaces-sdl2-vs2019.exe`.
108
109 The Release build crashes. The Debug build doesn't crash (but is rather slow) so this will be Fun for someone to debug.
110
111 To get a build suitable for playing Quake you'll need to use MinGW gcc, or download the autobuild from Xonotic (see above).
112
113
114 ## Contributing
115
116 [DarkPlaces Contributing Guidelines](CONTRIBUTING.md)
117
118 ## Documentation
119
120 Doxygen: https://xonotic.org/doxygen/darkplaces