Skip to content

Final Liberation: Warhammer Epic 40,000

Elisha Riedlinger edited this page Oct 13, 2023 · 6 revisions

Final Liberation: Warhammer Epic 40,000

Status

Supported on Windows 10/11

I am using the version of Final Liberation: Warhammer Epic 40,000 from GOG.

Patch updated: October 13th, 2023

Problem

The problem I had with Final Liberation: Warhammer Epic 40,000 was that it would crash on Windows 10 right after the first intro video.

Final Liberation: Warhammer Epic 40,000

Investigation

For the last several months I have been working on creating a wrapper to convert DirectDraw to Direct3D9. During my development I was able to get Final Liberation: Warhammer Epic 40,000 running using Direct3D9 only if I used dynamic textures in video memory. However, when using system memory the game would crash. I did not want my wrapper to use dynamic textures in video memory because they are significantly slower for many games than using system memory.

After some investigation I figured out why the game would crash when using system memory. The game has a defect in it were it would access the surface memory even after the surface had been released. However, once the surface had been released the memory is no longer valid and the game should not be accessing it. In fact, even when using video memory the game should not be accessing the memory of released surfaces, however for some reason Windows allows it.

Solution

One solution would be to simply retain the memory after the surface has been released. That would allow the game to function but in turn would cause another big issue, a memory leak.

A second solution would be to create an option to be able to configure dynamic textures in video memory for some games. This would of course allow the game to run, but I had two concerns with this solution. 1) I really wanted my wrapper to be able to fully implement all of the DirectDraw APIs without requiring any additional configuration options. 2) I had no idea if Windows would be updated later to break this, since what the game is doing is not valid and should really be blocked.

A third solution would be to make a custom patch for this game, to prevent it from accessing memory of surfaces that have been released. I have created custom patches for other games in the past (Star Trek Armada and Silent Hill 2). But I really wanted a generic solution, not a custom one.

Finally I decided the best solution would be to create a feature to allow the surface memory to be reused. How this would work is that when a surface was released I would keep the memory around and then the next surface that was similar would use the old surface memory. Only once the DirectDraw device was released would all the surface memory be released. Since the surface memory was being reused, it would not cause a memory leak. This also would be a certain way to ensure that all the memory addresses would always be available to the game.

Note: This fix will not only allow the game to run correctly on Windows 10/11, it also converts the game to use Direct3D9 for its rendering engine.

Installation

In order to install the Windows 10 patch for Final Liberation: Warhammer Epic 40,000 you can follow these steps:

  1. Download the fix below.
  2. Unzip the files to your Final Liberation: Warhammer Epic 40,000 installation folder (where the Epic40k.exe file exists).
  3. Start the game and enjoy!

If you run into issues check the compatibility settings. I am running with all compatibility settings disabled.

Compatibility Settings

Download

Here is the Download for the patch to fix Final Liberation: Warhammer Epic 40,000 on Windows 10/11.

This download contains 3 files:

  • ddraw.dll
  • dxwrapper.dll
  • dxwrapper.ini