X-Ray Engine is a game engine that was used by studio GSC to develop games from S.T.A.L.K.E.R. franchise.
X-Ray v2.0 was used to develop S.T.A.L.K.E.R. 2 until it got cancelled in 2011. This is a restoration project that aims to finish the engine and use it to re-create S.T.A.L.K.E.R. 2 as we know it from all leaked/released materials.
This project supports CMake v3.26 or higher to build its project files on all platforms (currently only on Windows - time will tell if we can get support on others as well).
Python scripts are part of post-CMake process setup. Ensure that you have Python 3.11 or higher installed.
Graphviz is used to generate project dependency graph after CMake script finishes execution. Its installers are available here.
Make sure that CMake, Python and Graphviz are added to your system variables.
You should use Visual Studio 2019 that has the following components (they can be added to your Visual Studio during installation or using Get Tools and Features panel):
- Workloads:
- Desktop development with C++
- Game development with C++
- .NET desktop development
- Individual components:
- C++ MFC for latest v142 build tools (x86 & x64)
- .NET Framework 3.5 development tools
- .NET Framework 4.8 SDK
- .NET Framework 4.8 Targeting Pack
- .NET Core 2.1 Runtime
- .NET Core 3.1 Runtime
It's also possible to use Visual Studio 2022 with v143 version of the toolset.
If you don't have it you can download Visual Studio 2022 here. To acquire older versions of Visual Studio please refer to this this link.
Additionally, you need .NET Framework v3.5 and v2.0 to run the SDK. Their installers can be found here.
The last necessary component is Microsoft DirectX SDK (June 2010) that is available here. Ideally, it should be installed in default directory suggested by the installer - default path is used by the solution creation script.
Source files of third party libraries aren't part of this repository. Consult with team members responsible for engine development in order to get necessary dependencies.
- Clone repository via SSH using Git Bash (
git clone git@git.dezowave.com:30001/dezowave/stk/xray.git) or use dedicated Git GUI client i.e. SourceTree or any other that supports Personal Access Token authorization to clone repository via HTTPS. - (Optional - this repository doesn't have any submodules at the moment) Update submodules using Git (
git submodule update --init --recursive) - Add all necessary third party libraries including their CMake scripts.
- Use CreateSlnVS2019.bat* located in build directory to generate solution files.
- Open X-Ray-v2.0.sln using Visual Studio 2019 or Visual Studio 2022 (make sure to use MSVC v142 build tools).
- Now you can Debug/Run from Visual Studio (ensure that game assets are in the right directory).
*You can use CreateSlnVS2022.bat if you wish to use v143 build tools, be sure to download proper C++ MFC library, like this one: C++ MFC v 14.33 (14.34) v143 build tools (x86 & x64).
- Build directory contains several utility tools that you can use in case new project has to be integrated into solution.
- If you updating CMakeLists.txt project files, don't forget to run Update.bat from build\ folder when projects will ask for reload or bugtrap, editor and some tools build will be broken.
- You can also disable ZERO_CHECK project, so it won't update your vs projects every time you touch cmake files, this is in case you have some critical changes in projects you didn't add yet to cmake.
- Rename RemoveDebugDefinition.json.lox_example in build\script_configs to RemoveDebugDefinition.json if you wana get mixed configuration.
-
Go to stalker2_pc_dx11 configuration properties->Debugging and set your working directory to compiled binaries, for example: C:\xray\binaries\Debug. Then put resources, mounts\ and user_data\ to your sources, now you can launch it. Or you can use a .bat file to start game like this one:
@start /Dbinaries\debug binaries\debug\xray_stalker2_pc_dx11.exe