A modern, open-source engine and game-code replacement for Prey (2006)
Features | Compatibility | Quick Start | Building | Documentation | TODO | Credits
Warning
Development Notice: This project leans heavily on exploratory, agentic AI "vibe coding" for speed. If you want a traditionally engineered codebase, this isn't for you.
The OpenPrey Project is a minimal, Prey-focused adaptation of the current OpenQ4 codebase. The project keeps the modernization work that makes current builds practical to develop and debug, but retargets the engine, tooling, and game-library workflow around Prey (2006) and its unified game-module model.
To use OpenPrey, you need:
- A legitimate copy of Prey (2006)
- OpenPrey engine binaries from this repository
- A supported host system for the current build/package flow: Windows x64, Linux x64, or macOS arm64
Note
OpenPrey does not include commercial Prey assets. On Windows, fs_basepath auto-discovery checks a valid override first, then the current working directory, registry install entries (including App Paths and uninstall metadata), and finally known legacy install roots such as Human Head Studios/Prey, 2K Games/Prey, and Games/Prey.
- Prey-first Runtime Layout: Unified
openprey/staging for engine overlays, game modules, GUI scripts, shaders, maps, and strings - Unified Game Module Model: Engine prefers
game_<arch>for both SP and MP, with legacygamex86/gamex64aliases still accepted during migration - Legacy Install Discovery: Windows install detection supports CD-era registry keys, App Paths, uninstall entries, and known install roots instead of assuming Steam/GOG-only layouts
- Official Asset Validation: Startup validation checks the required official Prey base PK4 layout before the game continues
- SDL3-first Windows Backend: SDL3 is the default window/input/display backend; the legacy Win32 backend remains transitional
- Meson + Ninja Build System: Canonical configure/build/install path with repo-local staging under
.install/ - Cross-platform Nightly Builds: GitHub Actions builds and packages Windows, Linux, and macOS artifacts from the same Meson staging flow
- Debug-Oriented Local Workflow:
.install/for staged runtime files,.home/for configs/logs/saves,.tmp/for task artifacts - Crash Diagnostics: Windows debug builds write crash logs and minidumps into
crashes/beside the executable
- Modern Window Modes: Windowed, borderless, desktop-native fullscreen, and exclusive fullscreen behavior are all supported
- Monitor Selection: SDL3 builds expose
r_screen,listDisplays, andlistDisplayModesfor multi-monitor setup - Staged Validation Launches: Repo-local launch workflows keep logs in
.home/logs/openprey.logand avoid writing back into the staged runtime tree
This status focuses on compatibility with official Prey assets and the OpenPrey game-library pipeline, not binary interchangeability with proprietary retail DLLs.
- Project Rebrand Completed: Meson project metadata, staged binaries, VS Code launch settings, and documentation now use OpenPrey naming
- Prey Install Discovery Path:
fs_basepathauto-detection now targets Prey registry/app-path/uninstall metadata and legacy install roots - Unified Game Module Loader: OpenPrey builds and stages a unified
game_<arch>module underopenprey/ - Companion Repo Tooling: Sync/build tooling now targets
OpenPrey-GameLibsand supports both Meson-wrapper and legacy VC-solution layouts - Official PK4 Layout Validation: Engine startup rejects missing or modified required base-pack layouts when
fs_validateOfficialPaks 1is enabled - Cross-host Meson Support: Meson source selection, dependency wiring, and nightly packaging now cover Windows, Linux, and macOS hosts
- Stock-asset SP/MP Smoke Validation: Default staged launch flow is still being verified across single-player and multiplayer startup cases
- Prey Gameplay Bring-up: Active
src/Preygame-library integration and runtime verification continue during the migration - Particle And FX Compatibility: Doom 3 / Prey-era particle behavior and dependent runtime paths still need restoration and parity checks
- Cross-host Runtime Validation: Windows remains the deepest runtime-validation path while Linux/macOS map validation is extended
- Full Campaign Completion: The project does not yet claim end-to-end single-player completion against stock assets
- Multiplayer Parity: Multiplayer compatibility remains under active validation
Current follow-up work is tracked in TODO.md, docs-dev/release-completion.md, and docs-dev/prey-gamelibs-compatibility-plan.md.
- Prey (2006) installed from original media or another legitimate distribution
- Supported build hosts: Windows x64, Linux x64, or macOS arm64
- Build tools: Meson, Ninja, and Python 3
- Windows compiler/toolchain: Visual Studio 2026+ recommended (MSVC 19.46+)
- Linux compiler/toolchain: GCC or Clang plus system
glew,openal,x11,xext, andxxf86vmdevelopment packages - macOS compiler/toolchain: Apple Clang with Homebrew
glew
Note
tools/build/meson_setup.ps1 automatically syncs ../OpenPrey-GameLibs on setup, compile, and install. Clone the companion repo alongside OpenPrey, or set OPENPREY_SKIP_GAMELIBS_SYNC=1 if you intentionally want to build only from the in-repo mirror.
-
Clone the repositories
git clone https://github.com/themuffinator/OpenPrey.git git clone https://github.com/themuffinator/OpenPrey-GameLibs.git cd OpenPrey -
Build and stage OpenPrey
Windows (PowerShell)
# Setup the build powershell -ExecutionPolicy Bypass -File tools/build/meson_setup.ps1 setup --wipe builddir . --backend ninja --buildtype=debug --wrap-mode=forcefallback # Compile powershell -ExecutionPolicy Bypass -File tools/build/meson_setup.ps1 compile -C builddir # Stage the local runtime package powershell -ExecutionPolicy Bypass -File tools/build/meson_setup.ps1 install -C builddir --no-rebuild --skip-subprojects
Linux / macOS (bash)
# Setup the build bash tools/build/meson_setup.sh setup --wipe builddir . --backend ninja --buildtype=release -Dplatform_backend=sdl3 # Compile bash tools/build/meson_setup.sh compile -C builddir # Stage the local runtime package bash tools/build/meson_setup.sh install -C builddir --no-rebuild --skip-subprojects
-
Run the staged build
Set-Location .install .\OpenPrey-client_x64.exe +set fs_game openprey +set fs_savepath ..\.home +set logFile 2 +set logFileName logs/openprey.log +set r_fullscreen 0
For a short single-player smoke test, append +set si_gameType singleplayer +map game/roadhouse_quick.
Detailed Build Instructions
- Meson 1.2.0 or newer
- Ninja build system
- Python 3
- Windows toolchain: Visual Studio 2026 / MSVC 19.46+ recommended
- Linux toolchain: GCC or Clang with system OpenGL/X11/OpenAL development packages
- macOS toolchain: Apple Clang with Homebrew
glew
-Dbuild_engine=true|false # Build OpenPrey-client_<arch> and OpenPrey-ded_<arch>
-Dbuild_games=true|false # Build the unified game module from the synchronized mirror
-Dplatform_backend=sdl3|legacy_win32|native
-Duse_pch=true|false
-Denforce_msvc_2026=true # Fail configure if MSVC is older than 19.46+
Windows (PowerShell)
# Configure
powershell -ExecutionPolicy Bypass -File tools/build/meson_setup.ps1 setup builddir . --backend ninja --buildtype=release
# Build
powershell -ExecutionPolicy Bypass -File tools/build/meson_setup.ps1 compile -C builddir
# Stage the runtime tree used for local validation
powershell -ExecutionPolicy Bypass -File tools/build/meson_setup.ps1 install -C builddir --no-rebuild --skip-subprojectsFrom a Developer Command Prompt
tools\build\openprey_devcmd.cmd
meson setup builddir . --backend ninja --buildtype=release
meson compile -C builddir
meson install -C builddir --no-rebuild --skip-subprojectsLinux / macOS
# Configure
bash tools/build/meson_setup.sh setup builddir . --backend ninja --buildtype=release -Dplatform_backend=sdl3
# Build
bash tools/build/meson_setup.sh compile -C builddir
# Stage the runtime tree used for local validation
bash tools/build/meson_setup.sh install -C builddir --no-rebuild --skip-subprojectsBuild directory (builddir/):
OpenPrey-client_x64.exe- main engine executableOpenPrey-ded_x64.exe- dedicated server executableopenprey/game_x64.dll- unified game module- import libraries and PDBs may be present in local debug builds
Staging directory (.install/):
OpenPrey-client_x64.exeOpenPrey-ded_x64.exeOpenAL32.dllwhen a bundled Windows runtime is available.install/openprey/game_x64.dll.install/openprey/{glprogs,guis,maps,materials,script,strings}/
meson install creates the local runtime tree used for testing and packaging input. Release packaging strips build-only artifacts such as .pdb, .lib, .exp, and .ilk.
GitHub nightly builds package the staged .install/ tree into:
-
openprey-<version-tag>-windows.zip -
openprey-<version-tag>-linux.tar.xz -
openprey-<version-tag>-macos.tar.gz -
openprey/game_<arch>.(dll|so|dylib)stays as a loose runtime module inside the packagedopenprey/directory -
staged overlay content is bundled into
openprey/pak0.pk4 -
Linux nightlies include staged
share/applicationsandshare/iconspayloads -
macOS nightlies include an
OpenPrey.applauncher bundle beside the packaged binaries -
the workflow publishes or updates a
nightly-<version-tag>GitHub release with generated notes
OpenPrey uses a unified runtime directory layout under openprey/:
.install/
|-- OpenAL32.dll # optional bundled runtime on Windows
|-- OpenPrey-client_x64.exe
|-- OpenPrey-ded_x64.exe
\-- openprey/
|-- game_x64.dll
|-- glprogs/
|-- guis/
|-- maps/
|-- materials/
|-- script/
\-- strings/
The engine uses the unified module model for both game modes:
- Single-player: loads
game_<arch>fromopenprey/ - Multiplayer: loads the same unified
game_<arch>module - Legacy compatibility:
gamex86/gamex64aliases are still accepted during migration
OpenPrey keeps SDK-derived game code in the companion OpenPrey-GameLibs repository. Canonical edits for SDK/game-library work belong there first; src/game in this repo is a synchronized mirror used by the Meson build, with additional src/Prey and src/preyengine sync paths brought in as needed for compatibility work.
- Default companion repo location:
../OpenPrey-GameLibs tools/build/meson_setup.ps1syncs the companion repo beforesetup,compile, andinstallOPENPREY_BUILD_GAMELIBS=1triggers an additional companion build-and-stage pass duringcompiletools/build/build_gamelibs.ps1can consume either a Meson wrapper or the current legacysrc/PREY.slnlayout- Legacy
OPENQ4_*environment variable names are still accepted as temporary migration aliases
The companion repo contains code derived from the Prey Software Development Kit and is subject to the original Human Head Studios SDK license.
The bundled SDK EULA allows non-commercial Prey modifications that run only with a legitimate copy of Prey, but it prohibits commercial exploitation and standalone redistribution of the SDK-derived code. See EULA.Development Kit.rtf in the OpenPrey-GameLibs repository for the full terms.
- Deliver a minimal, clean OpenQ4-to-Prey adaptation
- Preserve behavior expected by shipped Prey assets where practical
- Keep single-player and multiplayer behavior aligned with Prey's unified game-library model
- Prefer Doom 3 / Prey lineage behavior over inherited Quake 4 behavior where Prey depends on it
- Keep runtime staging and packaging centered on a single
openprey/directory
- Shipping proprietary Prey assets
- Reintroducing the old OpenQ4 closed-source companion-repo workflow
- Assuming Steam/GOG-only install layouts for Prey (2006)
- Fixing compatibility by shipping content hacks instead of repairing engine/game code
- Platform Support - Windows-first platform roadmap and SDL3 direction
- Porting Baseline - current OpenQ4 -> OpenPrey migration assumptions
- GameLibs Compatibility Plan - companion repo integration and game-library bring-up status
- Display Settings - fullscreen, borderless, monitor selection, and windowed sizing
- Input Key Matrix - keyboard and input reference
- Official PK4 Checksums - required Prey base pack layouts and published checksums
- Release Completion - shipped work and carry-forward items
- Project TODO - known issues and near-term tasks
OpenPrey validates the official Prey base-pack layout at startup when fs_validateOfficialPaks 1 is enabled (default).
How it works:
- Engine scans the detected
base/pack set - Chooses the required layout to validate against:
- classic retail naming (
pak000.pk4...pak004.pk4) - consolidated retail naming (
pak_data.pk4,pak_sound.pk4,pak_en_v.pk4,pak_en_t.pk4)
- classic retail naming (
- Refuses to continue if the required packs are missing or modified
Current checksum status:
- Consolidated retail pack checksums are published in official-pk4-checksums.md
- Classic retail pack names are enforced by presence, while canonical checksum capture is still being finalized
Display And Graphics Settings
r_screen -1- auto-select current display (default)r_screen 0..N- force a specific monitor on SDL3 buildslistDisplays- list monitor indiceslistDisplayModes [displayIndex]- list exclusive fullscreen modes for a display
r_fullscreen 0|1- windowed vs fullscreenr_fullscreenDesktop 1- desktop-native fullscreen (default)r_fullscreenDesktop 0- exclusive fullscreen usingr_mode/r_custom*r_mode -2- request native desktop resolution for fullscreen mode selectionr_borderless 1- borderless window whenr_fullscreen 0
r_windowWidth/r_windowHeight- window size when running windowed- Validation workflows should force
+set r_fullscreen 0
File System And Validation Settings
fs_basepath- detected Prey install rootfs_homepath- writable user pathfs_savepath- save/config/log path (defaults tofs_homepath)fs_game- active game directory (openprey)fs_devpath- optional developer override path used by local debug workflows
fs_validateOfficialPaks 1- verify required official base packs at startup- Launching from
.install/keeps the staged runtime overlay on the search path while letting.home/hold writable state
OpenPrey resolves engine dependencies through Meson subprojects and bundled Windows runtime assets:
| Library | Version | Purpose |
|---|---|---|
| SDL3 | 3.4.0 | Windowing, input, display management |
| GLEW | 2.3.4 | OpenGL extension loading |
| OpenAL Soft | bundled Windows package | 3D audio runtime |
| stb_vorbis | 1.22 | Ogg Vorbis decoding |
- Launch from
.install/in windowed mode with+set r_fullscreen 0 - Use
+set fs_savepath ..\.homeand+set logFileName logs/openprey.logto keep logs local to the repo - Inspect
.home\logs\openprey.logafter each short run - Fix warnings/errors in engine/game/parser/loader code before resorting to content-side workarounds
tools/build/meson_setup.ps1auto-detects and initializes the Visual Studio developer environment when neededcompile -C builddirauto-runssetup --wipeif the build directory is missing or invalidinstallauto-adds--skip-subprojectswhen omittedtools/build/openprey_devcmd.cmdis available if you want a reusable MSVC developer shell
- Use
OPENPREY_GAMELIBS_REPO=<path>to override the companion repo location - Use
OPENPREY_SKIP_GAMELIBS_SYNC=1to suppress automatic mirror sync - Use
OPENPREY_BUILD_GAMELIBS=1to build companion game libraries duringcompile - Use
OPENPREY_SKIP_GAMELIBS_BUILD=1to skip that additional companion build step
OpenPrey is open to contributions, but the project has a few hard constraints:
- Keep compatibility work centered on stock Prey assets
- Edit SDK-derived sources in
OpenPrey-GameLibsfirst; treatsrc/gamehere as a synchronized mirror - Preserve the unified
openprey/runtime layout - Keep documentation updated when workflow, naming, or repository structure changes
- Prefer engine/game fixes over shipping replacement assets or content hacks
OpenPrey is licensed under the GNU General Public License v3.0 (GPLv3).
The GPLv3 license applies to OpenPrey's engine code in this repository.
SDK-derived game-library code in OpenPrey-GameLibs remains subject to the original Prey SDK license.
Prey game assets are proprietary and are not distributed with OpenPrey.
OpenPrey builds on work from multiple projects and teams:
- themuffinator - OpenPrey development and maintenance
- Justin Marshall - Quake4Doom baseline and related reverse-engineering work
- Robert Backebans - RBDOOM-3-BFG modernization work that informs this ecosystem
- id Software - id Tech 4 lineage
- Raven Software - Quake 4 codebase lineage used by OpenQ4
- Human Head Studios - Prey (2006) and the Prey SDK
- Sean Barrett - stb_vorbis
- GLEW contributors
- OpenAL Soft contributors
- SDL contributors
OpenPrey is an independent project and is not affiliated with, endorsed by, or sponsored by Human Head Studios, 2K, Bethesda, ZeniMax, id Software, or Raven Software.
You must own a legitimate copy of Prey (2006) to use this software. OpenPrey does not include any copyrighted game assets.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. OpenPrey is experimental software under active development. Use it at your own risk.