6f70379476
Fixed out-of-scope variables usage. |
||
---|---|---|
.github | ||
2dlib | ||
AudioEncode | ||
bitmap | ||
cfile | ||
cmake | ||
dd_grwin32 | ||
dd_video | ||
ddebug | ||
ddio | ||
Descent3 | ||
editor | ||
fix | ||
grtext | ||
legacy | ||
lib | ||
libmve | ||
linux | ||
manage | ||
md5 | ||
mem | ||
misc | ||
model | ||
module | ||
music | ||
netcon | ||
netgames | ||
networking | ||
physics | ||
renderer | ||
rtperformance | ||
scripts | ||
sndlib | ||
stream_audio | ||
tests | ||
third_party | ||
tools | ||
ui | ||
unzip | ||
vecmat | ||
win32 | ||
.clang-format | ||
.clang-format-ignore | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
Brewfile | ||
CMakeLists.txt | ||
CMakePresets.json | ||
LICENSE | ||
README.md | ||
THIRD_PARTY.md | ||
vcpkg.json |
This is the Descent 3 open source engine, licensed under GPL-3.0. It includes the '1.5' patch written by Kevin Bentley and Jeff Slutter several years ago and brought to a stable condition by the Descent community.
In order to use this, you must provide your own game files. See the Usage section for details.
Version 1.5 Notes
There is no "release" yet. The current milestone is "1.5 Stable", which is meant to more or less be Descent 3 as it might have been if the 1.5 patch had made it to retail years ago. Artifacts can be downloaded from the Actions tab. The milestone needs testing on all platforms. Please report issues when found.
Usage
-
Make sure that you have a copy of Descent 3. You can purchase a copy of Descent 3 from GOG or Steam.
-
Install Descent 3.
-
Note for Steam users: If you own Descent 3 on Steam, then it’s recommended that you install the Windows version of the game even if you’re running macOS or Linux, otherwise movies will not work due to current lack of Ogv support. You can use either Steam Play or SteamCMD to install the Windows version of the game on macOS or Linux.
-
Note for non-Windows users: If you have the Windows version of the game on CDs but you don’t want to use Windows to install them, then you can follow these instructions:
How to install the Windows Dual-Jewel version of Descent 3 in Wine
- Make sure that you have Wine installed.
- (Recommended) Run
winecfg
and make sure that “Emulate a virtual desktop” is enabled. -
(Optional) Determine if you’re going to be affected by a bug with Descent 3’s installer, and potentially apply a workaround:
- Download Environment Size Checker.
- Run
wine environment-size-checker.exe
. - If that program tells you that your environment is more than 32,724 bytes large, then you’ll need to unset or shorten environment variables before running Descent 3’s installer. If you don’t, then the installer will page fault.
-
Install Descent 3:
- Insert disc 1.
- Make sure that disc 1 is mounted.
- Determine which drive letter Wine is using for your CD drive. (Hint: try running
wine explorer
). - Run
wine '<drive-letter>:\Setup.exe'
. - Follow the installation wizard’s instructions until it asks you to choose a “Setup Type”.
- Select the “Full” Setup Type, then click “Next”.
- Continue following the installation wizard’s instructions until it asks you to insert disc 2.
-
Switch to disc 2:
- Run
wine eject <drive-letter>:
. - Make sure that the disc was unmounted and ejected.
- Insert disc 2.
- Mount disc 2.
- Run
- Continue following the installation wizard’s instructions until it asks you to insert disc 1 again.
- Switch back to disc 1. Follow a similar procedure to the one that you used to switch to disc 2.
- Finish the going through the installation wizard.
- When the installation wizard finishes, it will open an explorer window. Close out of that window.
- Unmount the disc.
- Eject the disc.
-
Install Descent 3: Mercenary:
- Insert disc 3.
- Make sure that disc 3 is mounted.
- Run
wine start /d <drive-letter>: setup.exe -autorun
. - Follow the instructions in the installation wizard.
-
-
If your version of Descent 3 is older than v1.4, then update it to v1.4.
-
Create a new folder named
D3-open-source
. -
Copy the following files from your installation of Descent 3 to
D3-open-source
:- All
.hog
files - The
missions
folder - (Optional) All
.pld
files - (Optional) The
demo
folder - (Optional) The
movies
folder
- All
-
Create the
custom/
folder inD3-open-source
-
Obtain new Descent 3 engine files:
- If you want to use pre-built binaries, then download one of the artifacts from our latest CI run. You can find a list of CI runs here.
- If you want to build the engine files yourself, the follow these instructions. Once you build the engine files, they’ll be put in
builds/<platform>/Descent3/<build-type>/
. For example, if you’re using Linux and you create a “Release” build, then the files will be located atbuilds/linux/Descent3/Release
.
-
Copy all of the new engine files into
D3-open-source
and overwrite any conflicts. -
Run the game:
- On Windows, run
D3-open-source\Descent3.exe
. - On other platforms, run
D3-open-source/Descent3
.
- On Windows, run
-
Special notes:
- D3 Open Source compiles level scripts in their own hogfiles. Make sure you copy and overwrite
d3-{platform}.hog
.
- D3 Open Source compiles level scripts in their own hogfiles. Make sure you copy and overwrite
Building
Dependencies
The build process uses CMake and, by default, Ninja. You must install these; the project cannot locate them for you. The source code depends on SDL2 and zlib. You can supply these dependencies yourself via your system's library management tools, or the build system can locate the dependencies for you using vcpkg, a cross-platform dependency-management system developed by Microsoft. The official builds source their dependencies from vcpkg.
Installing and using vcpkg
- When building for Windows, vcpkg is already installed and configured when using any of the Visual Studio command prompts (either actual Command Prompt, or PowerShell).
- For Android, Linux or Mac (or non-standard-Windows) configurations, you will need to install vcpkg locally by cloning https://github.com/microsoft/vcpkg and setting your
VCPKG_ROOT
env var to the repository location. With this environment variable set, the build will automatically locate its dependencies.
Building - Windows
-
Install the prerequisite build tools.
Make sure that you have Git and Visual Studio 2022 with the “Desktop development with C++” workload and the “C++ MFC for latest v143 build tools (x86 & x64)” component. If you don’t already have those installed or you aren’t sure, then open an elevated Command Prompt and run:
```batch
winget install Git.Git Microsoft.VisualStudio.2022.Community
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\setup.exe" modify^ --passive^ --channelId VisualStudio.17.Release^ --productId Microsoft.VisualStudio.Product.Community^ --add Microsoft.VisualStudio.Workload.NativeDesktop;includeRecommended^ --add Microsoft.VisualStudio.Component.VC.ATLMFC
**NOTE:** Builds _must_ be performed in one of the Visual Studio-provided **x64 Native Tools** command prompts ("x64 Native Tools Command Prompt" or "x64 Native Tools PowerShell"), _not_ a standard Command Prompt or PowerShell. The VS prompts will already have vcpkg installed and configured for use, so no dependency management is needed.
-
Clone the Descent3 source code.
Open a "x64 Native Tools Command Prompt" or "x64 Native Tools PowerShell" and run:
git clone https://github.com/DescentDevelopers/Descent3
-
Build Descent3.
cd Descent3 cmake --preset win cmake --build --preset win --config [Debug|Release]
See Build Options below for more information on
Debug
vsRelease
.
Once CMake finishes, the built files will be put in builds\win\Descent3\Debug
or builds\win\Descent3\Release
.
Building - macOS
-
Install the prerequisite build tools.
-
Acquire the library dependencies.
- If you would like to use vcpkg:
NOTE: You will needgit clone https://github.com/microsoft/vcpkg export VCPKG_ROOT="$PWD/vcpkg"
$VCPKG_ROOT
defined in the environment for all build runs. It is a good idea to set this in your.bashrc
or equivalent. - If you would like to manage the code dependencies yourself:
brew install sdl2 zlib googletest
- If you would like to use vcpkg:
-
Clone the Descent3 source code.
git clone https://github.com/DescentDevelopers/Descent3
-
Build Descent3.
cd Descent3 brew bundle install cmake --preset mac cmake --build --preset mac --config [Debug|Release]
See Build Options below for more information on
Debug
vsRelease
.
Once CMake finishes, the built files will be put in builds/mac/Descent3/Debug
or builds/mac/Descent3/Release
.
Building - Linux
-
Install the prerequisite build tools.
- APT users (Debian, Ubuntu)
sudo apt update sudo apt install -y --no-install-recommends git ninja-build cmake g++
- DNF users (Red Hat, Fedora)
sudo dnf update --refresh sudo dnf install -y git ninja-build cmake gcc-c++
- APT users (Debian, Ubuntu)
-
Acquire the library dependencies.
- If you would like to use vcpkg:
- Clone vcpkg:
NOTE: You will needgit clone https://github.com/microsoft/vcpkg export VCPKG_ROOT="$PWD/vcpkg"
$VCPKG_ROOT
defined in the environment for all build runs. It is a good idea to set this in your.bashrc
or equivalent. - Install vcpkg-needed build tools and dependencies:
- APT users
sudo apt install -y --no-install-recommends curl pkg-config autoconf automake libtool libltdl-dev make python3-jinja2 libx11-dev libxft-dev libxext-dev libwayland-dev libxkbcommon-dev libegl1-mesa-dev libibus-1.0-dev libasound2-dev libpulse-dev libaudio-dev libjack-dev libsndio-dev
- DNF users
sudo dnf install -y autoconf automake libtool perl-open perl-FindBin python-jinja2 libX11-devel libXft-devel libXext-devel wayland-devel libxkbcommon-devel mesa-libEGL-devel ibus-devel alsa-lib-devel pulseaudio-libs-devel
- APT users
- Clone vcpkg:
- If you would like to manage the code dependencies yourself:
- APT users
sudo apt install -y --no-install-recommends libsdl2-dev zlib1g-dev libgtest-dev
- DNF users
sudo dnf install -y SDL2-devel zlib-devel gtest
- APT users
- If you would like to use vcpkg:
-
Clone the Descent3 source code.
git clone https://github.com/DescentDevelopers/Descent3
-
Build Descent3.
cd Descent3 cmake --preset linux cmake --build --preset linux --config [Debug|Release]
See Build Options below for more information on
Debug
vsRelease
.
Once CMake finishes, the built files will be put in builds/linux/Descent3/Debug
or builds/linux/Descent3/Release
.
Build Options
The Descent3 build can be customized by setting CMake variables on the command line during its "Configuration" phase (the command without the --build
option). To set a variable, you prepend the variable name with -D
and then append the value, all as one single parameter. For example:
cmake --preset linux -DENABLE_LOGGER=ON
NOTE: CMake variables, or more technically CMake cache entries, will persist in their values until they are explicitly cleared. So, if you set a variable and then run another CMake command without that variable specified, the variable will still be set. Variables must be explicitly unset, or the builds/
directory cleaned, in order to be cleared.
Option | Description | Default |
---|---|---|
CMAKE_BUILD_TYPE (or just --config , without the -D syntax) |
|
Debug |
BUILD_EDITOR |
(Windows-only) Build internal editor. | OFF |
BUILD_TESTING |
Enable testing. Requires GTest. | OFF |
ENABLE_LOGGER |
Enable logging to the terminal. | OFF |
ENABLE_MEM_RTL |
Enable Real-time library memory management functions (disable to verbose memory allocations). | ON |
FORCE_COLORED_OUTPUT |
Always produce ANSI-colored compiler warnings/errors (GCC/Clang only; esp. useful with Ninja). | OFF |
FORCE_PORTABLE_INSTALL |
Install all files into local directory defined by CMAKE_INSTALL_PREFIX . |
ON |
USE_VCPKG |
Explicitly control whether or not to use vcpkg for dependency resolution. ON requires the environment variable VCPKG_ROOT to be set. |
Determined by the existence of VCPKG_ROOT in the environment: If it exists, vcpkg is used. |
Contributing
Anyone can contribute! We have an active Discord presence at Descent Developer Network. If you are interested in maintaining the project on a regular basis, please contact Kevin Bentley.