Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 19 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# GD3D11 (Gothic Direct3D 11) Renderer [![GitHub Actions](https://github.com/kirides/GD3D11/actions/workflows/build.yml/badge.svg)](https://github.com/Kirides/GD3D11/actions) [![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/Kirides/GD3D11?include_prereleases)](https://github.com/Kirides/GD3D11/releases)
# GD3D11 (Gothic Direct3D 11) Renderer [![GitHub Actions](https://img.shields.io/github/actions/workflow/status/kirides/GD3D11/build-and-conditional-release.yml?logo=github&labelColor=24292e&color=28A745)](https://github.com/kirides/GD3D11/actions) [![GitHub latest release](https://img.shields.io/github/v/release/kirides/GD3D11?logo=github&labelColor=24292e&color=0969da)](https://github.com/kirides/GD3D11/releases/latest) [![GitHub nightly release](https://img.shields.io/github/v/release/kirides/GD3D11?include_prereleases&filter=nightly&logo=github&label=dev-release&labelColor=24292e&color=bf8700)](https://github.com/kirides/GD3D11/releases/tag/nightly)

This mod for the games **Gothic** and **Gothic II** brings the engine of those games into a more modern state. Through a custom implementation of the DirectDraw-API and using hooking and assembler-code-modifications of Gothic's internal engine calls, this mod completely replaces Gothic's old rendering architecture.

Expand All @@ -14,8 +14,6 @@ The new renderer is able to utilize more of the current GPU generation's power.
* Heightfog
* Normalmapping
* Full DynamicLighting
* Vegetationgeneration
* Hardware Tessellation
* Editor-Panel to insert some of the renderers features into the world
* Custom-Built UI-Framework based on Direct2D
* Rewritten bink player for better compatibility with bink videos
Expand All @@ -26,22 +24,22 @@ The new renderer is able to utilize more of the current GPU generation's power.
* Borderless LowLatency: ~10ms

## Installation & Usage
> **Note**: In the past there used to be separate files for Gothic 1 and Gothic 2, this has now changed since the mod will automatically detect the game.
1. Download the **GD3D11-*LATEST_VERSION*-ci.zip** file from the **Assets** section in the latest release of this repository (e.g. [kirides/releases](https://github.com/kirides/GD3D11/releases/latest)).
> [!NOTE]
> In the past there used to be separate files for Gothic 1 and Gothic 2, this has now changed since the mod will automatically detect the game.
1. Download the **GD3D11-*VERSION*.zip** file from the **Assets** section in the latest release of this repository (e.g. [kirides/releases](https://github.com/kirides/GD3D11/releases/latest)).
3. Unpack the zip file and copy the content into the `Gothic\system\` or `Gothic2\system\` game folder.
4. When starting the game you should see the version number of GD3D11 in the top-left corner.
5. As soon as you start the game for the first time after the installation you should press F11 to open the renderer menu and press `Apply(*)`. This saves all the options to `Gothic(2)\system\GD3D11\UserSettings.ini`.

## Bugs & Problems

### Known causes of crashing
* If you have problems with launching game after installing GD3D11 - for example getting Access Denied(0x45a), reinstall your Visual C++ Redistributable for Visual Studio 2015-2022 to latest version from Microsoft page, mod stopped working on older VCR due to some Microsoft changes in Platform Toolset.
https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#latest-microsoft-visual-c-redistributable-version
Select the `X86` installer `vc_redist.x86.exe` or click here: https://aka.ms/vs/17/release/vc_redist.x86.exe
* If you have problems with launching game after installing GD3D11 - for example getting Access Denied(0x45a), reinstall your *Visual C++ Redistributable v14 (X86)* to latest version from [Microsoft website](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170), mod stopped working on older VCR due to some Microsoft changes in Platform Toolset.
https://aka.ms/vc14/vc_redist.x86.exe

### AMD

* For AMD RDNA+ graphics cards (RX 5xxx, RX 6xxx, RX 7xxx, RX 9xxx, ..)
* For AMD RDNA+ graphics cards (RX 5xxx, RX 6xxx, RX 7xxx, RX 9xxx, )
installing DXVK (32-Bit, dxgi.dll & d3d11.dll) may help with Out-Of-Memory crashes.

> @Shoun2137:
Expand All @@ -68,7 +66,7 @@ WINEPREFIX=~/.wine-gothic WINEARCH=win32 winetricks -q directmusic dxvk vcrun202
using `winecfg` above, add `dinput` and `ddraw` as dll overrides (native, then built-in)
and remove `dsound` from overrides as that breaks Gothic 2.

Afterwards, launch your game(s) like this
Afterward launch your game(s) like this
```sh
cd /mnt/games/gothic1/system/
WINEPREFIX=~/.wine-gothic WINEARCH=win32 wine ./GothicMod.exe
Expand All @@ -82,7 +80,7 @@ WINEPREFIX=~/.wine-gothic WINEARCH=win32 wine ./GothicStarter.exe

### Latest version

Building the mod is currently only possible with windows, but should be easy to do for anyone. To build the mod, you need to do the following:
Building the mod is currently only possible with Windows, but should be easy to do for anyone. To build the mod, you need to do the following:

- Download & install **Git** (or any Git client) and clone this GitHub repository to get the GD3D11 code.
- Download & install **Microsoft Visual Studio 2019** (Community Edition is fine, make sure to enable C++ Tools during installation!). Might work on 2015 or 2017 but untested.
Expand All @@ -100,24 +98,28 @@ To build GD3D11, open its solution file (.sln) with Visual Studio. It will the l
* Gothic 2 Develop: "Release_NoOpt"
* Gothic 1 Develop: "Release_NoOpt_G1"

> **Note**: A real "debug" build is not possible, since mixing debug- and release-DLLs is not allowed, but for the Develop targets optimization is turned off, which makes it possible to use the debugger from Visual Studio with the built DLL when using a Develop target.
> [!IMPORTANT]
> A real "debug" build is not possible, since mixing debug- and release-DLLs is not allowed, but for the Develop targets optimization is turned off, which makes it possible to use the debugger from Visual Studio with the built DLL when using a Develop target.

Select the target for which you want to built (if you don't want to create a release, select one of the Develop targets), then build the solution. When the C++ build has completed successfully, the DLL with the built code and all needed files (pdb, shaders) will be copied into the game directory as you specified with the environment variables.
Select the target for which you want to build (if you don't want to create a release, select one of the Develop targets), then build the solution. When the C++ build has completed successfully, the DLL with the built code and all needed files (pdb, shaders) will be copied into the game directory as you specified with the environment variables.

After that, the game will be automatically started and should now run with the GD3D11 code that you just built.

When using a Develop target, you might get several exceptions during the start of the game. This is normal and you can safely continue to run the game for all of them (press continue, won't work for "real" exceptions of course).
When using a Develop target, you might get several exceptions during the start of the game. This is normal, and you can safely continue to run the game for all of them (press continue, won't work for "real" exceptions of course).
When using a Release target, those same exceptions will very likely stop the execution of the game, which is why you should use Develop targets from Visual Studio and test your release builds by starting Gothic 1/2 directly from the game folder yourself.

### Producing the Redistributables
- Compile all versions (e.g. by running `BuildAll.bat`)
- Run `CreateRedist_All.bat` to create separate zip files containing the required files
> **Note**: On CI this process is different. Release builds will bundle all DLL files (SpacerNET is a seperate build) and the launcher will decide which version should be used at runtime. Therefore there is only one zip file for Gothic 1 and Gothic 2.
- Build all required configurations including the Launcher
- Copy required assets (shaders, textures, fonts, libraries) and the generated binaries into the release structure
> [!TIP]
> Check out the GitHub Actions workflow to see how the releases are build.

### Dependencies

- HBAO+ files from [dboleslawski/VVVV.HBAOPlus](https://github.com/dboleslawski/VVVV.HBAOPlus/tree/master/Dependencies/NVIDIA-HBAOPlus)
- [AMD FidelityFX SDK](https://github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK)
- [AntTweakBar](https://sourceforge.net/projects/anttweakbar/)
- [Dear ImGui](https://github.com/ocornut/imgui)
- [assimp](https://github.com/assimp/assimp)

## Special Thanks
Expand Down