Skip to content
Open
Show file tree
Hide file tree
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
66 changes: 65 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,67 @@ jobs:
name: opengothic_${{ needs.setup.outputs.semver }}_linux_x64.deb
path: opengothic_${{ needs.setup.outputs.semver }}_linux_x64.deb

linux-arm64:
needs: setup
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y glslang-tools libvulkan-dev libasound2-dev libx11-dev libxcursor-dev

- name: Generate build version
run: |
echo '#pragma once' > game/build.h
echo "static const char* appBuild = \"${{ needs.setup.outputs.version }}\";" >> game/build.h

- name: Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}

- name: Build
run: cmake --build build --target Gothic2Notr -j $(nproc)

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: opengothic_${{ needs.setup.outputs.semver }}_linux_arm64
path: build/opengothic/Gothic2Notr

linux-deb-arm64:
needs: setup
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential devscripts debhelper cmake g++ \
glslang-tools libvulkan-dev libasound2-dev libx11-dev libxcursor-dev

- name: Generate build version
run: |
echo '#pragma once' > game/build.h
echo "static const char* appBuild = \"${{ needs.setup.outputs.version }}\";" >> game/build.h
dch -v "${{ needs.setup.outputs.semver }}" -D unstable -M "Automated build"

- name: Build Debian package
run: |
dpkg-buildpackage -us -uc -b
cp ../opengothic_*.deb opengothic_${{ needs.setup.outputs.semver }}_linux_arm64.deb

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: opengothic_${{ needs.setup.outputs.semver }}_linux_arm64.deb
path: opengothic_${{ needs.setup.outputs.semver }}_linux_arm64.deb

windows:
needs: setup
runs-on: windows-2025
Expand Down Expand Up @@ -204,7 +265,7 @@ jobs:

release:
if: startsWith(github.ref, 'refs/tags/')
needs: [setup, linux, linux-deb, windows, macos-arm64, macos-x64]
needs: [setup, linux, linux-deb, linux-arm64, linux-deb-arm64, windows, macos-arm64, macos-x64]
runs-on: ubuntu-24.04
permissions:
contents: write
Expand All @@ -219,6 +280,7 @@ jobs:
VERSION: ${{ needs.setup.outputs.semver }}
run: |
cd artifacts/opengothic_${VERSION}_linux_x64 && zip -r ../opengothic_${VERSION}_linux_x64.zip . && cd ../..
cd artifacts/opengothic_${VERSION}_linux_arm64 && zip -r ../opengothic_${VERSION}_linux_arm64.zip . && cd ../..
cd artifacts/opengothic_${VERSION}_win_x64 && zip -r ../opengothic_${VERSION}_win_x64.zip . && cd ../..
cd artifacts/opengothic_${VERSION}_osx_arm64 && zip -r ../opengothic_${VERSION}_osx_arm64.zip . && cd ../..
cd artifacts/opengothic_${VERSION}_osx_x64 && zip -r ../opengothic_${VERSION}_osx_x64.zip . && cd ../..
Expand All @@ -231,6 +293,8 @@ jobs:
files: |
artifacts/opengothic_${{ needs.setup.outputs.semver }}_linux_x64.zip
artifacts/opengothic_${{ needs.setup.outputs.semver }}_linux_x64.deb/opengothic_${{ needs.setup.outputs.semver }}_linux_x64.deb
artifacts/opengothic_${{ needs.setup.outputs.semver }}_linux_arm64.zip
artifacts/opengothic_${{ needs.setup.outputs.semver }}_linux_arm64.deb/opengothic_${{ needs.setup.outputs.semver }}_linux_arm64.deb
artifacts/opengothic_${{ needs.setup.outputs.semver }}_win_x64.zip
artifacts/opengothic_${{ needs.setup.outputs.semver }}_osx_arm64.zip
artifacts/opengothic_${{ needs.setup.outputs.semver }}_osx_x64.zip
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.16)

project(Gothic2Notr LANGUAGES C CXX)
include(GNUInstallDirs)
set(CMAKE_CXX_STANDARD 20)
set(BUILD_SHARED_LIBS OFF)

Expand Down Expand Up @@ -186,4 +187,5 @@ if(${CMAKE_BUILD_TYPE} MATCHES "Debug")
endif()

# installation
install(TARGETS ${PROJECT_NAME} DESTINATION bin)
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES doc/Gothic2Notr.6 DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
40 changes: 21 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,22 +158,24 @@ The game menu in Gothic 2 is done by scripting. While the original graphics sett
Rendering distance is not customizable.

## Command line arguments
| Argument(s) | Description |
| ---------------------- | ------- |
| `-g` | specify path containing Gothic game data |
| `-game:<modfile.ini>` | specify game modification manifest (GothicStarter compatibility) |
| `-nomenu` | skip main menu |
| `-devmode` | enable marvin-mode at start of the game |
| `-w <worldname.zen>` | startup world; newworld.zen is default |
| `-save q` | load the quick save on start |
| `-save <number>` | load a specified save-game slot on start |
| `-v -validation` | enable validation layers for graphics api |
| `-dx12` | force DirectX 12 renderer instead of Vulkan (Windows only) |
| `-g1` | assume a Gothic 1 installation |
| `-g2c` | assume a Gothic 2 classic installation |
| `-g2` | assume a Gothic 2 night of the raven installation |
| `-rt <boolean>` | explicitly enable or disable ray-query |
| `-gi <boolean>` | explicitly enable or disable ray-traced global illumination |
| `-ms <boolean>` | explicitly enable or disable meshlets |
| `-aa <number>` | enable anti-aliasing (number = 1-2, 2 = most expensive AA) |
| `-window` | windowed debugging mode (not to be used for playing) |
| Argument(s) | Description |
| ---------------------- | ------- |
| `-g` | specify path containing Gothic game data |
| `-game:<modfile.ini>` | specify game modification manifest (GothicStarter compatibility) |
| `-nomenu` | skip main menu |
| `-devmode` | enable marvin-mode at start of the game |
| `-w <worldname.zen>` | startup world; newworld.zen is default |
| `-save q` | load the quick save on start |
| `-save <number>` | load a specified save-game slot on start |
| `-v -validation` | enable validation layers for graphics api |
| `-dx12` | force DirectX 12 renderer instead of Vulkan (Windows only) |
| `-g1` | assume a Gothic 1 installation |
| `-g2c` | assume a Gothic 2 classic installation |
| `-g2` | assume a Gothic 2 night of the raven installation |
| `-rt <boolean>` | explicitly enable or disable ray-query |
| `-gi <boolean>` | explicitly enable or disable ray-traced global illumination |
| `-ms <boolean>` | explicitly enable or disable meshlets |
| `-aa <number>` | enable anti-aliasing (number = 1-2, 2 = most expensive AA) |
| `-window` | windowed debugging mode (not to be used for playing) |
| `-benchmark [ci]` | run automated benchmark, reports avg/1% low FPS to stdout and log.txt; `ci` exits after completion |
| `-h` `--help` | show help message |
5 changes: 1 addition & 4 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ override_dh_update_autotools_config:
override_dh_auto_configure:
dh_auto_configure -- \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_BINDIR=games \
-DZK_ENABLE_INSTALL=OFF \
-DINSTALL_LIBS=OFF \
-DINSTALL_CMAKE_FILES=OFF

# Custom install: only install the binary
override_dh_auto_install:
install -D -m 755 obj-*/opengothic/Gothic2Notr debian/opengothic/usr/games/Gothic2Notr
145 changes: 145 additions & 0 deletions doc/Gothic2Notr.6
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
.\" Man page for Gothic2Notr (OpenGothic)
.TH GOTHIC2NOTR 6 "January 2026" "OpenGothic" "Games"
.SH NAME
Gothic2Notr \- open source re-implementation of Gothic 2: Night of the Raven
.SH SYNOPSIS
.B Gothic2Notr
.RB [ \-g
.IR path ]
.RB [ \-game:\fImodfile.ini\fR ]
.RB [ options ]
.SH DESCRIPTION
.B OpenGothic
is a feature-complete Gothic game client, compatible with the original
game data and mods. It makes the original Gothic 1 and Gothic 2 work on
modern systems using Vulkan graphics (or Metal on macOS, DirectX 12 on Windows).
.PP
Gothic 2: Night of the Raven is required as OpenGothic does not provide
any built-in game assets or scripts.
.SH OPTIONS
.TP
.BI \-g " path"
Specify the path containing Gothic game data. If not provided, OpenGothic
attempts to auto-detect common installation paths.
.TP
.BI \-game: modfile.ini
Specify a game modification manifest file (GothicStarter compatibility).
.TP
.B \-nomenu
Skip the main menu and start the game directly.
.TP
.B \-devmode
Enable marvin-mode (developer/debug mode) at the start of the game.
.TP
.BI \-w " worldname.zen"
Specify the startup world. Default is newworld.zen.
.TP
.B \-save q
Load the quick save on start.
.TP
.BI \-save " number"
Load a specified save-game slot on start.
.TP
.BR \-v ", " \-validation
Enable validation layers for the graphics API (useful for debugging).
.TP
.B \-dx12
Force DirectX 12 renderer instead of Vulkan (Windows only).
.TP
.B \-g1
Assume a Gothic 1 installation.
.TP
.B \-g2c
Assume a Gothic 2 classic installation (without Night of the Raven).
.TP
.B \-g2
Assume a Gothic 2: Night of the Raven installation.
.TP
.BI \-rt " boolean"
Explicitly enable or disable ray-query. Affects only capable hardware.
Off by default for integrated GPUs.
.TP
.BI \-gi " boolean"
Explicitly enable or disable ray-traced global illumination.
.TP
.BI \-ms " boolean"
Explicitly enable or disable meshlets (mesh shaders).
.TP
.BI \-aa " number"
Enable anti-aliasing. Number can be 0-2, where 2 is the most expensive AA.
.TP
.B \-window
Windowed debugging mode (not recommended for normal play).
.TP
.BI \-benchmark " [ci]"
Run an automated benchmark without user input. Reports average FPS and
1% low FPS to the console, log.txt, and standard output. Typically used
with
.B \-devmode \-nomenu
for automated testing. If
.B ci
is specified, the program exits automatically after completion (useful
for regression testing). The benchmark can be restarted in-game with
.B ztoggle timedemo
or cancelled by loading a save game.
.TP
.BR \-h ", " \-\-help
Print a brief help message and exit.
.SH GRAPHICS OPTIONS
The in-game menu provides additional graphics settings:
.TP
.B Cloud Shadows
Mapped to SSAO (Screen Space Ambient Occlusion).
.TP
.B Radial Fog
Mapped to volumetric fog.
.TP
.B Reflections
Screen space reflections.
.TP
.B Video settings
Internal 3D rendering resolution can be altered here. UI and text
are always rendered at full resolution.
.SH MODIFICATIONS
Mods can be installed as usual. Provide the modfile.ini to OpenGothic via
the
.B \-game:
parameter to play.
.PP
.B Supported:
Content mods (retexture/reworld/animations) that only rely on regular
scripting and do not use memory hacking.
.PP
.B Not supported:
Ikarus/LeGo (partial support in progress), Union, DX11 Renderer,
AST SDK, Ninja.
.SH FILES
.TP
.I save_slot_0.sav
Quick save file, stored in the current working directory.
.TP
.I save_slot_1.sav " ... " save_slot_15.sav
Regular save files, stored in the current working directory.
.TP
.I log.txt
Log file created in the current working directory.
.PP
On macOS, if Gothic data is located in
.IR ~/Library/Application\ Support/OpenGothic/ ,
the working directory is changed there automatically, so saves and logs
are stored alongside the game data.
.SH EXIT STATUS
.TP
.B 0
Successful program execution.
.TP
.B non-zero
An error occurred, check log.txt for details.
.SH BUGS
Report bugs at https://github.com/Try/OpenGothic/issues
.SH SEE ALSO
Project homepage: https://github.com/Try/OpenGothic
.PP
Discord community: https://discord.gg/G9XvcFQnn6
.SH AUTHORS
OpenGothic is developed by Try and contributors.
30 changes: 29 additions & 1 deletion game/commandline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <Tempest/Log>
#include <Tempest/TextCodec>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cassert>

#if defined(__APPLE__)
Expand Down Expand Up @@ -48,7 +50,33 @@ CommandLine::CommandLine(int argc, const char** argv) {
std::string_view mod;
for(int i=1;i<argc;++i) {
std::string_view arg = argv[i];
if(arg.find("-game:")==0) {
if(arg=="-h" || arg=="--help") {
std::printf(
"Usage: Gothic2Notr [options]\n"
"\n"
"Options:\n"
" -g <path> Path to Gothic game data\n"
" -game:<mod.ini> Load game modification\n"
" -nomenu Skip main menu\n"
" -devmode Enable marvin-mode\n"
" -w <world.zen> Startup world (default: newworld.zen)\n"
" -save q|<number> Load quick save or save slot\n"
" -v, -validation Enable graphics validation layers\n"
" -dx12 Force DirectX 12 (Windows only)\n"
" -g1, -g2c, -g2 Assume Gothic 1/2 Classic/2 NotR\n"
" -rt <0|1> Enable/disable ray-query\n"
" -gi <0|1> Enable/disable ray-traced GI\n"
" -ms <0|1> Enable/disable meshlets\n"
" -aa <0-2> Anti-aliasing level\n"
" -window Windowed mode\n"
" -benchmark [ci] Run benchmark (ci: exit after)\n"
" -h, --help Show this help\n"
"\n"
"See Gothic2Notr(6) man page for details.\n"
);
std::exit(0);
}
else if(arg.find("-game:")==0) {
if(!mod.empty())
Log::e("-game specified twice");
mod = arg.substr(6);
Expand Down