When working on changes to Unvanquished game paks, it is inconvenient to work directly with the
.dpk package file format (see DPK) used in production, since it is a Zip archive. Hence, the Dæmon engine supports the
.dpkdir package directory format for working in the native filesystem. This article details a couple of possible workflows for development using a dpkdir.
Method 1: Quick and dirty modifications to an existing zipped package
- Find the package you want to modify in the pakpath. Let's say it's
res-weaponsand the file is called
res-weapons_0.51.dpkinto a folder named
wipis a version string which is arbitrary, but must be "greater" than
res-weapons_wip.dpkdirshould be in the same directory as the original dpk.
- Make your modifications inside the dpkdir directory tree.
- Start/restart the game. A
/devmap(map change) suffices—it is not necessary to restart the entire program.
A disadvantage of this method: it is easy to forget to delete the dpkdir when you are done.
Method 2: Working from the source Git repository
This section describes a workflow for working from source for the
- Check out the Git repository. If you have already checked out the
Unvanquishedrepository, then the
unvanquishedpackage source exists as a submodule located at
Unvanquished/pkg/unvanquished_src.dpkdir. Alternatively, you can check out any dpkdir repository directly.
- Ensure your repo is up to date:
cd pkg/unvanquished_src.dpkdir git fetch origin && git checkout origin/master
- Make your modifications in the directory tree of the Git repository.
- Launch Unvanquished, specifying the parent directory of the repository as a pakpath. Supposing you checked out the Unvanquished repository at
~/code/Unvanquished, the command might be
~/code/Unvanquished/build/daemon -pakpath ~/code/Unvanquished/pkg. Adding the pakpath requires a full restart, but subsequent pak reloads can be done via a map change.
- Use the
whichcommand to verify that files are being loaded from your dpkdir:
/which scripts/blaster.shader File "scripts/blaster.shader" found in "C:\Users\slipher\Documents\My Games\Unvanquished\pkg/res-weapons_0.51.dpk"
- In your operating system's settings you can associate the
.dpkfile extension with a zip archive browser such as 7-Zip to enable convenient inspection of paks (DPK packages make use of Zip format).
- If you want to create a new package rather than modify an existing one, set the cvar
fs_extrapaksto the package name. This will not work reliably if you need to override a file that exists in another package.