How to build a 64bit - w23/xash3d-fwgs GitHub Wiki

Oh boy

So you want to try this, huh?

Note that it is a work in progress. It will most certainly look weird, have glitches, not work as expected, or completely refuse to work.

Why do you even need 64bit build?

Ray tracing extensions are only supported for 64bit processes. 32bit process just won't see any ray tracing available even when using the latest drivers and a capable GPU. Therefore, for RTX_ON we need to build 64bit binaries.

What if I'm running GNU/Linux?

It works on Linux too, and in fact it is mostly developed on Linux. Note: As of early 2023 it is possible to use open source mesa amdgpu drivers. Just set RADV_PERFTEST=rt environment variable prior to running it. It can be ~30% slower than proprietary amdgpu-pro drivers, but it works, and even runs on Steam Deck!

Get stuff

Half-Life game data

You need to e.g. install Steam version or something. Older/original (WON) GoldSrc one, not newer Source one.

Vulkan SDK

Windows: Download one from https://vulkan.lunarg.com/ and install it.

GNU/Linux: or install from the package manager or https://vulkan.lunarg.com/sdk/home#linux

SDL2

Windows:

  1. Get (Visual C++ 32/64-bit) SDL2 from https://github.com/libsdl-org/SDL/releases/tag/release-2.30.11 Example: SDL2-devel-2.30.11-VC.zip
  2. Unpack it somewhere. Example: C:\SDL2-2.30.11

GNU/Linux: just install SDL if you haven't already

Xash3D-FWGS engine

git clone --recursive https://github.com/w23/xash3d-fwgs

HLSDK-Xash3D

git clone https://github.com/FWGS/hlsdk-portable

Build things

Build Xash3D

Windows:

cd xash3d-fwgs
./waf configure -8 -T debug --sdl2=C:\SDL2-2.30.11
./waf install --destdir=path_to_maindir
cd ..

GNU/Linux:

cd xash3d-fwgs
./waf configure -8 -T debug
./waf install --destdir=path_to_maindir
cd ..

Now xash3d engine is installed in path_to_maindir.

Copy Half-Life data

Just copy the entire Half-Life/valve directory to path_to_maindir/ (not its contents, but the valve directory itself)

Copy SDL dll (only for Windows)

Copy C:\SDL2-2.30.11\lib\x64\SDL2.dll to path_to_maindir/

Build HLSDK-Xash3d

This is required because native/original Half-Life client.dll/so is 32-bit, and we're not.

cd hlsdk-portable
./waf configure -8 -T release
./waf install --destdir=path_to_maindir
cd ..

Run

Now you can cd to path_to_maindir and run xash3d.exe or xash3d

Example command line: xash3d -ref vk -vkdebug -dev 2 -log +map c1a0d where:

  • -ref vk engages Vulkan renderer
  • -vkdebug ensures that additional debug checks/labels are present (useful for renderdoc-debugging) and that validation layers are engaged (useful to lower probability of corrupting gpu state)
  • -dev 2 enables verbose logging and console access
  • -log makes all console log messages written into engine.log file, useful for debugging too
  • +map c1a0d makes you load a semi-useful map immediately, spares you from navigating menus, etc.