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 we need to build 64bit binaries.

What if I'm running Linux?

It works on Linux too, and in fact it is mostly developed on Linux. Instructions are essentially the same, just s/dll/so/g and you should be good to go. 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 is at lest ~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

Download one from https://vulkan.lunarg.com/ and install it. If you're on Linux there's a high chance that you can just use your package manager to install it.

SDL2

  1. Get (Visual C++ 32/64-bit) SDL2 from https://www.libsdl.org/download-2.0.php. Example: SDL2-devel-2.28.5-VC.zip
  2. Unpack it somewhere. Example: C:\SDL2-devel-2.28.5-VC

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

cd xash3d-fwgs
./waf configure -8 -T debug --sdl2=C:\SDL2-devel-2.28.5-VC
./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

Copy C:\SDL2-devel-2.28.5-VC\lib\x64\SDL2.dll to path_to_maindir/

Build HLSDK-Xash3d

This is required because native/original Half-Life client.dll 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

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.