• Register

The X-ray Engine is a DirectX 8.1/9 Shader Model 3.0 graphics engine. Up to a million polygons can be on-screen at any one time. The engine features HDR rendering, parallax and normal mapping, soft shadows, motion blur, widescreen support, weather effects and day/night cycles. As with other engines that utilise deferred shading, the X-ray Engine does not support anti-aliasing with dynamic lighting enabled. However, a "fake" form of anti-aliasing can be enabled with the static lighting option; this format utilizes a technique to blur the image to give the false impression of anti-aliasing. The game takes place in a thirty square kilometer area, and both the outside and inside of this area is rendered to the same amount of detail. Some textures in the game were simply photographs of the walls in the developers' studio.

Post tutorial Report RSS Running Call of Chernobyl on Linux with Wine

A quick guide for running Call of Chernobyl (or STALKER in general) on Linux with Wine.

Posted by on - Basic Other

This guide assumes that the reader is at least somewhat familiar with his distribution of choice and isn't afraid of the terminal. While this guide is written with Ubuntu in mind, it should be fairly simple to use with other distributions.

First of all: if you have an Nvidia GPU, make sure you are using Nvidia's proprietary drivers. Ubuntu has an easy-to-use utility for installing them.

Acquiring Call of Chernobyl:

Same as on Windows: just download the mod and unpack it where you want.

Setting up Wine for STALKER with DX8 and DX9 rendering:

Install Wine using a repository directly from the Wine developers. Select your distribution, follow the instructions and install the staging branch of wine (winehq-staging package). This way you will always have the latest version of Wine. Wine development is quite rapid so you don't want to be stuck on possibly years old versions from your distribution's repository.

Next you will have to install some runtime libraries to make the game run properly. Install "winetricks" package from your distribution's repository and then run the following command:

winetricks d3dx9

This will install official DX9 runtime libraries to our Wine installation.

Now you can just double click Stalker-CoC.exe and the game should start up! Make sure to use DX8 or DX9 rendering at this point. DX11 may or may not launch, the DX11 support on stock Wine is still very poor. We will add better support for more recent versions of DirectX next.

Adding better DX10 and DX11 support with DXVK:

While the game is playable in DX9 mode using normal Wine, you have to rely on an old method of translating DirectX calls to OpenGL. DXVK is a fairly recent project that translates DX10 and DX11 calls to Vulkan instead. I gained around 20-30fps on some levels by using the DX10 renderer with DXVK instead of the DX9 renderer with vanilla Wine.

DXVK requires you to have up-to-date graphics drivers. Ubuntu 19.04 (or newer) users should have recent enough drivers out of the box. 18.04 LTS users can follow this guide to get them.

After making sure your drivers are recent enough, you can install DXVK itself. Download the latest release from DXVK's GitHub page. Unpack the downloaded archive, navigate into the dxvk folder containing setup_dxvk.sh and run the following command

./setup_dxvk.sh install

You will also need some more runtime libraries to get the DX10 and 11 renderers working. Run

winetricks d3dcompiler_43 d3dx10_43 d3dx11_43

to install them.

Now you can start the game and change the renderer to DX10 or 11! You know that DXVK is working if it creates some log files in the game's directory (xrEngine_d3d11.log and xrEngine_dxgi.log when playing stalker). If you get a black screen or the game minimizes automatically (and the log files are created so you know that DXVK is correctly installed), try alt-tabbing in and out of the game window a few times.

Command line arguments and environment variables:

Command line arguments are used with Wine like they are used in Windows and everywhere else, you just have to run the executeables with the wine command. For example: launching Call of Chernobyl in debug mode

wine Stalker-CoC.exe -dev

DXVK has some useful environment variables, such as DXVK_HUD. This can display useful information such as the current framerate and device info. Example: launching CoC in debug mode and using DXVK HUD to display some information

DXVK_HUD=1 wine Stalker-CoC.exe -dev

You can create a small script in the game directory if you are always using some of these options. I have a script called dbg-wine.sh which contains:

#!/bin/bash
DXVK_HUD=version,devinfo,fps wine Stalker-CoC.exe -dev "$@"

sdalger

Good hunting, stalker!

Further reading:

Here are some links for more in-depth Wine documentation.

stalker tux

Post comment Comments
zxcv64
zxcv64 - - 198 comments

Good work!

Reply Good karma Bad karma+6 votes
kcs123
kcs123 - - 943 comments

Nice article.

Reply Good karma Bad karma+4 votes
Darryl123
Darryl123 - - 1,161 comments

Couple of things to add to this, as I've had some issues myself.

1)

If you are using Bumblebee for a dual NVIDIA/Intel setup, it is better to use the "primusrun" command rather than "optirun" when trying to get the game to use your NVIDIA GPU.

Because Stalker-CoC.exe also doesn't work for me either, to launch the game I have to execute a .sh file with the following two lines. This file should be placed in the same directory as the regular launcher.

COC_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
primusrun wine "$COC_DIR/bin/xrEngine.exe" -dev

Make sure to mark that file and xrEngine.exe as executable, and you should be able to launch the game properly.

2)

You might also want to launch "winecfg" from the terminal and open the graphic tab, then enable the automatic capture of your mouse when in fullscreen, and the emulation of a virtual desktop set to whatever resolution you plan to use.

This prevents the game window crashing my desktop environment, changing my display resolution, or just bugging out on me in general.

Reply Good karma Bad karma+3 votes
Guest
Guest - - 689,423 comments

This comment is currently awaiting admin approval, join now to view.

Guest
Guest - - 689,423 comments

It worked for this game, but any game is running 10x slower now. What is wrong? Linux Mint 20.3 Una 64-bit

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: