Coder Social home page Coder Social logo

try / opengothic Goto Github PK

View Code? Open in Web Editor NEW
1.1K 44.0 77.0 25.65 MB

Reimplementation of Gothic 2 Notr

License: MIT License

CMake 0.83% C++ 75.87% Batchfile 0.01% GLSL 4.92% Shell 0.01% C 18.33% Objective-C++ 0.04%
gothic2 remake gothic vulkan rpg-engine

opengothic's Introduction

OpenGothic

Open source re-implementation of Gothic 2: Night of the Raven.

Motivation: The original Gothic 1 and Gothic 2 are still great games, but it's not easy to make them work on modern systems. The goal of this project is to make a feature complete Gothic game client compatible with the original game data and mods.


Latest build

Screenshoot

Work in progress

Build status

Development is focused on Gothic 2 and new features are not tested for Gothic 1 compatibility. While Gothic 1 is not officially supported pull requests that fix Gothic 1 — and general — bugs are welcome.

The original game has been replicated fully; you can complete both the main quest and the addon. Check out the bugtracker for a list of known issues.

OpenGothic is designed to utilize features of modern graphic hardware and api's like mesh shaders or ray tracing. While mesh-shader not mandatory, yet don't expect OpenGothic to run well on low-end or outdated graphic cards.

Prerequisites

Gothic 2: Night of the Raven is required as OpenGothic does not provide any built-in game assets or scripts.

Supported systems are:

  • Windows (DX12, Vulkan)
  • Linux (Vulkan)
  • MacOS (Metal)

How to play

Windows

  1. If not already done install Gothic. OpenGothic comes with auto-path detection if your Gothic files are in a common path.

    • "C:\Program Files (x86)\JoWooD\Gothic II"
    • "C:\Gothic II"
    • "C:\Program Files (x86)\Steam\steamapps\common\Gothic II"
  2. Download OpenGothic and extract into a folder of your choice. Available options are:

    • A Pre-Release (recommended)
    • Alternatively a recent test build from CI
  3. Run Gothic2Notr.exe.

    If nothing happens check log.txt and look for the line invalid gothic path. In this case OpenGothic fails to find your Gothic installation and you have to explicitly specify its location via -g paramter. Either you create a shortcut to Gothic2Notr.exe and change the target line in Properties to e.g.

    Gothic2Notr.exe -g "C:\Program Files (x86)\Steam\steamapps\common\Gothic II"

    or you can edit Gothic2Notr.bat and run this file instead.

Linux

  1. If not already done install Gothic via Wine/Proton or copy the game files from a Windows installation.

  2. You can download a build from CI and extract into a folder of your choice. Alternatively OpenGothic can be built manually. For Arch the AUR provides a 3rd party package.

  3. Run Gothic2Notr.sh -g "~/PlayOnLinux's virtual drives/Gothic2_gog/drive_c/Gothic II" (example path, use path to your Gothic installation instead)

    You can edit Gothic2Notr.sh and change the line exec "$DIR/Gothic2Notr" "$@" to

    exec "$DIR/Gothic2Notr" "$@" -g "~/PlayOnLinux's virtual drives/Gothic2_gog/drive_c/Gothic II"

    to not have to enter path manually every time. Then run Gothic2Notr.sh without arguments to start.

MacOS

  1. If not already done install Gothic. Instructions how to obtain the game files can be found here. OpenGothic comes with auto-path detection if your Gothic files are in "~/Library/Application Support/OpenGothic".

  2. Download a build from Mac Source Ports and follow the installation instructions given there. Alternatively recent test builds are available from CI that can be extracted into a folder of your choice. You can compile a fresh build as well.

  3. Run Gothic2Notr.sh

    If OpenGothic fails to find your Gothic files you have to explicitly specify its location via -g parameter. Change the line exec "$DIR/Gothic2Notr" "$@" to reflect your Gothic path e.g.

    exec "$DIR/Gothic2Notr" "$@" -g "~/PlayOnLinux's virtual drives/Gothic2_gog/drive_c/Gothic II"


Modifications

Mods can be installed as usual. Provide the modfile.ini to OpenGothic via -game: parameter to play. Example:

Gothic2Notr.exe -game:Karibik.ini

What's working?

Content mods (retexture/reworld/animations) that only rely on regular scripting and do not use memory hacking.

What's not?

  • Ikarus/LeGo

There are ongoing efforts to support parts of it to make at least some popular mods like Chronicles of Myrtana playable. Progress can be tracked in the corresponding issue. An explanantion how Ikarus works is given here.

  • Union (32 bit and Windows only, not possible)
  • DX11 Renderer - same as Union, but don't worry - OpenGothic has nice graphics out of the box
  • AST sdk
  • Ninja

Build Instructions

Linux

Install dependencies:

  • Ubuntu 20.04/22.04 and their derived distros
source <(cat /etc/os-release | grep UBUNTU_CODENAME)
# latest Vulkan SDK provided externally as Ubuntu packages are usually older
wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-${UBUNTU_CODENAME}.list http://packages.lunarg.com/vulkan/lunarg-vulkan-${UBUNTU_CODENAME}.list
sudo apt update
sudo apt install vulkan-sdk

# distro-provided packages
sudo apt install git cmake g++ glslang-tools libvulkan-dev libasound2-dev libx11-dev libxcursor-dev
  • Arch
sudo pacman -S git cmake gcc glslang vulkan-devel alsa-lib libx11 libxcursor vulkan-icd-loader libglvnd
  • Fedora
sudo dnf install git cmake gcc-c++ glslang vulkan-loader-devel alsa-lib-devel libX11-devel libXcursor-devel vulkan-validation-layers-devel libglvnd-devel

Compilation

# 1st time build:
git clone --recurse-submodules https://github.com/Try/OpenGothic.git
cd OpenGothic
cmake -B build -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
make -C build -j $(nproc)

# following builds:
git pull --recurse-submodules
make -C build -j $(nproc)

Executables can be located at OpenGothic/build/opengothic.

MacOS

brew install glslang
git clone --recurse-submodules https://github.com/Try/OpenGothic.git
cd OpenGothic
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
cmake --build ./build --target Gothic2Notr

Executables can be located at OpenGothic/build/opengothic.

Video

Video

Available Graphic options

Game menu in gothic is done by scripting. While orignal graphics settings do not apply to current-gen graphics, engine redefines meaning for some of tweakables:

  • Settings -> Extended configuration
    • Cloud Shadows mapped to SSAO.
    • Radial Fog mapped to "Volumetric fog"
    • Reflections reused, for screen space reflections
  • Settings -> Video settings
    • Internal rendering resolution, for 3D, can be altered here. UI and text is always rendered at full resolution.
  • Application command line:
    • Ray tracing: setting affects only capable hardware, off by default for igpu's, add -rt 1 to enable

Rendering distance is not customizable.

Command line arguments

Argument(s) Description
-g specify path containing Gothic game data
-game:<modfile.init> 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
-fxaa <number> enable FXAA anti-aliasing (number = 1-5, 5 = most expensive AA)
-window windowed debugging mode (not to be used for playing)

opengothic's People

Contributors

christophhaag avatar creimer avatar da3m0nsec avatar errorflexxx avatar eulenmensch93 avatar fhanrath avatar herzenschein avatar hhirsch avatar houkama avatar hwnde avatar kirillalekseeenko avatar kuzy000 avatar lmichaelis avatar matthiakl avatar mufabo avatar newbytee avatar nindaleth avatar okkindel avatar poetakodu avatar q4a avatar raphaelahrens avatar reveares avatar sjavora avatar smatc avatar striezel avatar swick avatar thielhater avatar thokkat avatar try avatar yuriytaranov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opengothic's Issues

Case sensitiveness issue on linux

Hello.

First of all: Wow. This is an amazing project. Thank you for this.

I tried to compile and start the project on a linux machine.
After installing CMake 3.12 from a third party repo (kitware) and installing glslang-tools it built very smooth with only one warning so far. Nice.

After starting a new game, it turned out, that the player controls were'nt working. I debugged a bit and discovered that

std::unique_ptr<IniFile>                baseIniFile;
std::unique_ptr<IniFile>                iniFile;

couldn't be found. Therefore all control keys were unset.
The reason, why the files could'nt be found, was the following:
In my installation (German CDs: Gothic II Normal + Addon) the folder and ini file was named in different case:
"System/Gothic.INI" instead of "system/Gothic.ini".
After I renamed the folder and the file, the player controls has been working.

For a general solution, I digged myself down in the code and made the following observations:

  1. I found pieces of code, that might be required to solve the problem in the following places:
  • Game/utils/fileutil.h: exists
  • Game/utils/fileext.h: hasExt, exchangeExt
  • Game/gothic.h: caseInsensitiveSegment
  • lib/MoltenTempest/Engine/utility/dir.h: scan
  1. String conversions are done at various places and the usage seems to have been mixed up sometimes (I've seen so far: char*, std::string, std::u16string, unicode 8 conversion being used as std::wstring). That's just a subjective impression.

I want to offer you the following changes, but want to ask for your opinions beforehand:

  • Implementation of dedicated String classes, that are inheriting from the std::string, std::wstring, etc. and implement support functions, that are required at different places (toUpper, toLower, indexOf, equals, replace, trim, conversion from string/wstring/u16string,u32string to each other string).
  • Implementation of a path class, that would be an specialization of the upper listed String class, that handles often required functions: getFilename, getExtension, getFilenameWithExtention, isAbsolute, isRelative, dirUp or concatenation of paths.
  • After that an explorer class might be useful, to search for files / directories recursively or not and case sensitive or not. This class might be implemented with std::expermimental::fs features that should be available at >= c++14.

What do you think about that approach ? Do you want to have it done that way ?
The way of not specializing the std::string and using more static support functions might be a good approach, too. It would look more like the std::string instead of yet another custom util string.

I'm curious about your opinions 👍

Possible integer overflow in InventoryMenu::onTakeStuff

Miss this minor issue on code review:

void InventoryMenu::onTakeStuff() { 
  uint8_t itemCount = 0;
  auto& page = activePage();
  auto& sel = activePageSel();
  if(sel.sel >= page.size())
    return;
  auto& r = page[sel.sel];
  if(lootMode==LootMode::Normal) {
    ++takeCount;
    itemCount = pow(10,takeCount / 10);
    if(r.count() <= itemCount) {
      itemCount = r.count();   // <<----- HERE: uint8_t = size_t
      takeCount = 0;
    }
  }

While it's hard to meet this condition in real game, still should be fixed

Expendable items usage

  1. Fix spell-scrolls usage: for now player can cast spell unlimited amount of times
  2. Fix documents/books usage: notes disappear from inventory, after reading

Build failed on Linux with error: clearing an object of non-trivial type

Actual master code build fails on Linux with gcc version 9.2.1 (on Arch Linux). Build fails on file zCModelMeshLib.h with error:
error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘ZMath::float3’ {aka ‘struct ZMath::t_vector<ZMath::t_float3, float, float, float>’}; use assignment or value-initialization instead [-Werror=class-memaccess] 37 | memset(&m_RootNodeTranslation, 0, sizeof(m_RootNodeTranslation));

Problem lies here:

memset(m_BBox, 0, sizeof(m_BBox));
memset(m_BBoxCollision, 0, sizeof(m_BBoxCollision));
memset(&m_RootNodeTranslation, 0, sizeof(m_RootNodeTranslation));

It's more warning than error because use of memset to init memory of non-trivial types probably sometimes can fail (not in this case since other builds works) but source code is compiled with -Werror option so warnings are treated like errors. Didn't checked whole source but probably there are more places to fail with similar errors.

PS: After removing -Werror option from CMakeLists.txt compilation ended successfully.

Aim of this project is not clear

Hey there,

this might be a noob question but I wanted to ask what's the goal of your project. This project got mentioned on reddit and worldofplayers and by REGoth devs and I'm unsure what to expect. You write DX11 can't be run with this "client-app" but you will provide some graphical features like shadows it seems. I wonder if this could compete with DX11 mod and if it would be as good or better performance-wise.

Here in short what I would expect of a reimplementation:

  • better performance, so game could be run on modern hardware w/o bottlenecking
  • graphical features like shadows, grass, HBAO, tesselation and so on
  • cross-platform playability or at least smooth to be run on W10

Greets

Npc_CanSeeNpc returns wrong value, when npc sitting on a bench.

Seem like Npc_CanSeeNpc should use BIP01 rotation, to calculate eye-dir vector.
B_AssessTalk :

		if(Npc_CanSeeNpc(self,other))
		{
			AI_StartState(self,ZS_Talk,0,"");
		}
		else
		{
			if(Npc_IsInState(self,ZS_ObservePlayer))
			{
				AI_Standup(self);
			};
			AI_StartState(self,ZS_Talk,1,"");
		};

Random Segmentation fault on Game save [linux]

If the game is saved, theres a ~25 % chance to get a segmentation fault.

File: MoltenTempest/Engine/gapi/vulkan/vframebufferlayout.cpp
On current master line 38

bool VFramebufferLayout::isCompatible(const VFramebufferLayout &other) const {
  if(this==&other)
    return true;
  if(attCount!=other.attCount) //SIGSEGV on game save
    return false;
  for(size_t i=0;i<attCount;++i)
    if(frm[i]!=other.frm[i])
      return false;
  return true;
  }

It can be reproduced with starting a game and saving it ~3-4 times.

Crash with Gothic II (Gold Edition)

Hi!
I tried to run the pre-release gothic-win32-v1.0.69 with a new Gothic II (Gold Edition) installation from DVD on Windows 10 but got a crash.

Executed:

.\Gothic2Notr.exe -g "D:\JoWooD\Gothic II"

Crash log:

unable to read .ini file

---crashlog(SIGABRT)---
0x00470abc: CrashLog::dumpStack(char const*) in d:\JoWooD\open_gothic\bin\Gothic2Notr.exe
0x00470989: signalHandler(int) in d:\JoWooD\open_gothic\bin\Gothic2Notr.exe
0x75e972b1: raise in C:\WINDOWS\System32\msvcrt.dll
0x75e9b76b: abort in C:\WINDOWS\System32\msvcrt.dll
0x004709ae: CrashLog::setup() in d:\JoWooD\open_gothic\bin\Gothic2Notr.exe
0x6fe59399: ZN10__cxxabiv111__terminateEPFvvE in d:\JoWooD\open_gothic\bin\libstdc++-6.dll
0x0045376a: Renderer::initSwapchain(unsigned int, unsigned int) in d:\JoWooD\open_gothic\bin\Gothic2Notr.exe
0x0045dd04: MainWindow::initSwapchain() in d:\JoWooD\open_gothic\bin\Gothic2Notr.exe
0x0045b9f4: MainWindow::resizeEvent(Tempest::SizeEvent&) in d:\JoWooD\open_gothic\bin\Gothic2Notr.exe
0x6b6b99f4: ZN7Tempest6Widget6resizeEii in d:\JoWooD\open_gothic\bin\libMoltenTempest.dll
0x6b6d7a09: ZN7Tempest6Window4Impl8onResizeEPNS_9SystemApi6WindowEii in d:\JoWooD\open_gothic\bin\libMoltenTempest.dll
0x6b684e95: ZN7Tempest9SystemApi10showCursorEb in d:\JoWooD\open_gothic\bin\libMoltenTempest.dll
0x760d48eb: AddClipboardFormatListener in C:\WINDOWS\System32\USER32.dll
0x760b613c: CallWindowProcW in C:\WINDOWS\System32\USER32.dll
0x760b568f: CallWindowProcW in C:\WINDOWS\System32\USER32.dll
0x6edfea7e: glDebugEntry in C:\WINDOWS\SYSTEM32\opengl32.dll
0x760d48eb: AddClipboardFormatListener in C:\WINDOWS\System32\USER32.dll
0x760b613c: CallWindowProcW in C:\WINDOWS\System32\USER32.dll
0x760b5cda: CallWindowProcW in C:\WINDOWS\System32\USER32.dll
0x760be6bf: IsRectEmpty in C:\WINDOWS\System32\USER32.dll
0x77c740ed: KiUserCallbackDispatcher in C:\WINDOWS\SYSTEM32\ntdll.dll
0x760b799d: GetSystemMetrics in C:\WINDOWS\System32\USER32.dll
0x760cac40: UnionRect in C:\WINDOWS\System32\USER32.dll
0x73b198eb: OpenThemeData in C:\WINDOWS\system32\uxtheme.dll
0x73b27c18: GetThemeBackgroundRegion in C:\WINDOWS\system32\uxtheme.dll
0x760c6ba7: DefMDIChildProcA in C:\WINDOWS\System32\USER32.dll
0x6b684ed3: ZN7Tempest9SystemApi10showCursorEb in d:\JoWooD\open_gothic\bin\libMoltenTempest.dll
0x760d48eb: AddClipboardFormatListener in C:\WINDOWS\System32\USER32.dll
0x760b613c: CallWindowProcW in C:\WINDOWS\System32\USER32.dll
0x760b568f: CallWindowProcW in C:\WINDOWS\System32\USER32.dll
0x6edfea7e: glDebugEntry in C:\WINDOWS\SYSTEM32\opengl32.dll
0x760d48eb: AddClipboardFormatListener in C:\WINDOWS\System32\USER32.dll
0x760b613c: CallWindowProcW in C:\WINDOWS\System32\USER32.dll
0x760b5cda: CallWindowProcW in C:\WINDOWS\System32\USER32.dll
0x760beed7: RemovePropW in C:\WINDOWS\System32\USER32.dll
0x77c740ed: KiUserCallbackDispatcher in C:\WINDOWS\SYSTEM32\ntdll.dll
0x0045dad8: MainWindow::setFullscreen(bool) in d:\JoWooD\open_gothic\bin\Gothic2Notr.exe
0x0045a644: MainWindow::MainWindow(Gothic&, Tempest::VulkanApi&) in d:\JoWooD\open_gothic\bin\Gothic2Notr.exe
0x0045a0a8: _main in d:\JoWooD\open_gothic\bin\Gothic2Notr.exe
0x004013e2: ___tmainCRTStartup in d:\JoWooD\open_gothic\bin\Gothic2Notr.exe
0x75716359: BaseThreadInitThunk in C:\WINDOWS\System32\KERNEL32.DLL
0x77c67a94: RtlGetAppContainerNamedObjectPath in C:\WINDOWS\SYSTEM32\ntdll.dll
0x77c67a64: RtlGetAppContainerNamedObjectPath in C:\WINDOWS\SYSTEM32\ntdll.dll

Hlp_GetNpc search

Current implementation of Hlp_GetNpc is just bad: not performing search at all.

Chapter 3 startup

  1. Lothar is not dead
  2. Paladins at the pass is still alive
  3. Dead novices are not really dead

Unable to talk properly with Feodaron(fire dragon on Irdotar)

unexpected aiOutput call: DIA_Dragon_Fire_Island_Hello_20_00
unexpected aiOutput call: DIA_Dragon_Fire_Island_Hello_15_01
unexpected aiOutput call: DIA_Dragon_Fire_Island_Hello_20_03
unexpected aiOutput call: DIA_Dragon_Fire_Island_Hello_15_06
unexpected aiOutput call: DIA_Dragon_Fire_Island_Hello_20_07

Multiple invocation of 'enter_di_firsttime_trigger'

This function invoked by TriggerScript.
If players dexterity is bellow 15, script gonna spam dexPotion endlessly.
It' unclear to me: is it game-script bug or opengothic-engine bug?

func void enter_di_firsttime_trigger()
{
	if(Npc_HasItems(hero,ItKe_Ship_Levelchange_MIS))
	{
		Npc_RemoveInvItems(hero,ItKe_Ship_Levelchange_MIS,1);
	};
	if(hero.attribute[ATR_DEXTERITY] < 15)
	{
		Wld_InsertItem(ItPo_Perm_DEX,"FP_ITEM_DI_ENTER_05");
	};
	if(EnterDI_Kapitel6 == FALSE) // run_once guard
...
	};
};

Can't save the game [linux]

I tried to debug it some time now, but this seems to be a bit tricky.

So here are the infos I got:

  • Terminal output says: "loading error: unable to open file"
  • Inside the game, the text is displayed: "unable to write savegame file."
  • A savefile is created with filename: save_slot_1.sav and it has 963,7 kB. It's located beneath the Gothic2Notr executable.
  • One time I saw, he stopped in bool GameMenu::implUpdateSavThumb(GameMenu::Item& sel)
    while reading the SaveGameHeader. He wanted to read 4 but only read 0.
    The callstack looked like this was another thread.

Not easy to find, but it smells like a race condition, or ?
I'll continue searching, but maybe you already have an idea.

Myxir is dead

After Raven's death:
изображение

Assume correct behavior is to teleport mage away from game-world.
Offended script:

if(RavenIsDead == TRUE)
{
	B_RemoveNpc(KDW_14030_Addon_Myxir_ADW);
};

func void B_RemoveNpc(var int npcInstance)
{
	var C_Npc npc;
	npc = Hlp_GetNpc(npcInstance);
	if(Hlp_IsValidNpc(npc) && !Npc_IsDead(npc))
	{
		npc.flags = 0;
		AI_Teleport(npc,"TOT"); // what if no such point?
		B_StartOtherRoutine(npc,"TOT");
		Npc_ChangeAttribute(npc,ATR_HITPOINTS,-npc.attribute[ATR_HITPOINTS_MAX]);
		AI_Teleport(npc,"TOT"); // why?!
	};
};

OpenAL crash on startup

Hi, I just found and want to try this awesome project! But I have a problem with launching the game.

I'm running the command

./Gothic2Notr.exe -g "D:\Steam\steamapps\common\Gothic II"

which immediately outputs

AL lib: (EE) WinMMOpenPlayback: waveOutOpen failed: 1

---crashlog(std::system_error(No device))---
GPU: ?
[no call frames available]

By googling that error, it looks like it comes from external lib OpenAL (winmm.c#L328). Some incompatibility with my sound card maybe? I don't know, but I tried two different Gothic II Notr versions, so it shouldn't be the problem. I'm using Windows 10.

"Out of device memory" error during startup

info from crashlog:

---crashlog(std::system_error(Out of device memory))---
GPU: GeForce GTX 750
[no call frames available]

The error has occurred since version 1.0.406. Before, everything worked ok.

Block monster atacks

It was impossible, in original game, to block monster attack, by using Action+Back key-combinations.

"lost device!" on startup

I compiled OpenGothic on Linux and - after some fiddling with the files - I managed to get the game into a state where strace doesn't report any obvious file not found errors any more. However the game is now stuck with the following output:

no *.ini file in path - using default settnigs
no *.ini file in path - using default settnigs
GPU = GeForce GTX 960
Depth format = 6 Shadow format = 4
lost device!

I assume this has something to do with Vulkan, but I have no experience with it. I can only tell that other Vulkan games are running perfectly fine.

Is the game supposed to at least start on Linux, or is this expected?

Scripting: api-comlete gothic2

This is a ticket to track not implemented api remaining.

func void Mdl_ApplyRandomAni(var C_Npc npc, var string s1, var string s2)
func void Mdl_ApplyRandomAniFreq(var C_Npc npc, var string s1, var float f2)
func void Mdl_ApplyRandomFaceAni(var C_Npc npc, var string name, var float timeMin, var float timeMinVar, var float timeMax, var float timeMaxVar, var float probMin)
Priority: low

func AI_StopFx(var C_Npc npc, var string csName)
Used by func void UseItPo_PotionOfDeath()
Priority: low
Note: tears of Innos

func bool Wld_IsRaining()
Used by B_Say_GuildGreetings.d
Priority: low

Error while running the Gothic

---crashlog(SIGABRT)---
GPU: ?
0x00493376: CrashLog::dumpStack(char const*) in ...\bin\Gothic2Notr.exe
0x00493211: signalHandler(int) in ...\bin\Gothic2Notr.exe
0x769c83c1: raise in C:\Windows\System32\msvcrt.dll
0x769cc84b: abort in C:\Windows\System32\msvcrt.dll
0x00493236: CrashLog::setup() in ...\bin\Gothic2Notr.exe
0x6fe59399: ZN10__cxxabiv111__terminateEPFvvE in ...\bin\libstdc++-6.dll
0x00475de8: _main in ...\bin\Gothic2Notr.exe
0x004013e2: ___tmainCRTStartup in ...\bin\Gothic2Notr.exe
0x754a0419: BaseThreadInitThunk in C:\Windows\System32\KERNEL32.DLL
0x7764662d: RtlGetAppContainerNamedObjectPath in C:\Windows\SYSTEM32\ntdll.dll
0x776465fd: RtlGetAppContainerNamedObjectPath in C:\Windows\SYSTEM32\ntdll.dll

Support case-sensitive file systems

OpenGothic aborts on my linux machine…

#0  0x00007f10e3557e35 in raise () from /lib64/libc.so.6
#1  0x00007f10e3542895 in abort () from /lib64/libc.so.6
#2  0x00000000008d130d in terminateHandler () at /home/swick/Projects/opengothic/OpenGothic/Game/utils/crashlog.cpp:70
#3  0x00007f10e38fa86c in ?? () from /lib64/libstdc++.so.6
#4  0x00007f10e38fa8c7 in std::terminate() () from /lib64/libstdc++.so.6
#5  0x00007f10e38fab29 in __cxa_throw () from /lib64/libstdc++.so.6
#6  0x00007f10e3e399dd in Tempest::RFile::implOpen (
    cstr=0x273e990 "/home/swick/Games/Gothic 2 Gold/_work/Data/Scripts/_compiled/Fight.dat")
    at /home/swick/Projects/opengothic/OpenGothic/lib/MoltenTempest/Engine/io/rfile.cpp:57
#7  0x00007f10e3e398e8 in Tempest::RFile::RFile (this=0x7ffce1eecbd0, 
    path=0x273e9e0 u"/home/swick/Games/Gothic 2 Gold/_work/Data/Scripts/_compiled/Fight.dat")
    at /home/swick/Projects/opengothic/OpenGothic/lib/MoltenTempest/Engine/io/rfile.cpp:38
#8  0x00007f10e3e3995e in Tempest::RFile::RFile (this=0x7ffce1eecbd0, 
    path=u"/home/swick/Games/Gothic 2 Gold/_work/Data/Scripts/_compiled/Fight.dat")
    at /home/swick/Projects/opengothic/OpenGothic/lib/MoltenTempest/Engine/io/rfile.cpp:43
#9  0x000000000081b4dd in Gothic::createVm (this=0x7ffce1eee9a0, 
    datFile=0xa50ed8 u"_work/Data/Scripts/_compiled/Fight.dat")
    at /home/swick/Projects/opengothic/OpenGothic/Game/gothic.cpp:415
#10 0x0000000000798014 in FightAi::FightAi (this=0x273e8a0, gothic=...)
    at /home/swick/Projects/opengothic/OpenGothic/Game/game/definitions/fightaidefinitions.cpp:6
#11 0x000000000081997d in Gothic::Gothic (this=0x7ffce1eee9a0, argc=3, argv=0x7ffce1eeec68)
    at /home/swick/Projects/opengothic/OpenGothic/Game/gothic.cpp:74
#12 0x000000000087fb3e in main (argc=3, argv=0x7ffce1eeec68)
    at /home/swick/Projects/opengothic/OpenGothic/Game/main.cpp:16

It tries to open /home/swick/Games/Gothic 2 Gold/_work/Data/Scripts/_compiled/Fight.dat but it doesn't exist. FIGHT.DAT however does.

Detect Gothic minor version

In "Night of the Raven", there was a behavior change for AI-State scripts.

  1. Need to detect ZEngine version expected by game scripts
  2. If AI script missing {STATE}_Loop function:
  • NOTR - endless ai-state
  • Others - one-time ai-state

Tests cases: ZS_DEATH; ZS_GETMEAT

Crash with Gothic II (GOG)

When I try to start OpenGothic, the window opens and closes a second later. This is all what's written into crash.log:

---crashlog(ExceptionFilter)---
GPU:
0x00486ce2: CrashLog::dumpStack(char const*) in C:\open_gothic\bin\Gothic2Notr.exe
0x00486ac9: __ZL16exceptionHandlerP19_EXCEPTION_POINTERS@4 in C:\open_gothic\bin\Gothic2Notr.exe
0x7640a4eb: UnhandledExceptionFilter in C:\WINDOWS\System32\KERNELBASE.dll
0x76f8302c: RtlCaptureStackContext in C:\WINDOWS\SYSTEM32\ntdll.dll
0x76f465fd: RtlGetAppContainerNamedObjectPath in C:\WINDOWS\SYSTEM32\ntdll.dll

CMake install missing for Gothic2Notr binary and MoltenTempest shared object

Right now make install completely fails for a number of reasons:

  1. an install macro for the Gothic2Notr binary is missing so the binary doesn't get installed at all
  2. an install macro for libMoltenTempest.so is missing. Alternatively MoltenTempest can switch to building a static library instead.

Running directly from the build dir is also broken on linux. If you want to link MoltenTempest as a shared library, LD_LIBRARY_PATH has to be set to the CMAKE_LIBRARY_OUTPUT_DIRECTORY directory in a wrapper script (or you start linking it statically).

Another point is that you should not overwrite CMAKE_BINARY_DIR at all! The user chose the build dir for a reason. You can still support running from the build dir.

[Linux] Case sensitiveness while loading music

Some sound files can't be found on linux systems, due to case sensitiveness issues.
As the music filenames are coming from Deadalus Scripts, I guess, the engine should deal with that issue.

Example output:

unable to load sound: "nw_daystd_A0.sgt"
unable to load sound: "nw_dayfgt.sgt"
unable to load sound: "nw_daystd_A0.sgt"
unable to load sound: "nw_dayfgt.sgt"

Files exist here: Gothic II/_work/Data/Music/NewWorld/NW_DayStd_A0.sgt.

As a proposal, I made some changes that carry out the Gothic::nestedPath feature to the OpenGothic/utils/fileUitls part and enable the musicLoader to use the case sensitive file search, too.
I'll create a PR for that change, so that it can be discussed in there.

Faster loot

  1. If player hold action-button, the number of items to take has to be increased *10, for every 10 take action
  2. Need to implement take *10, take *100 hotkeys

Non english game text

For now game font menu.ttf/main.ttf have no support for non-english letters.
Workaround: replace font files

Cross-platform support?

I'm wondering if cross-platform support is planed for the future, in particular if this should run in Linux.

Thanks!

Add COW strings for script

Need to optimize string operations in AI-scripts:

if(Hlp_StrCmp(Npc_GetNearestWP(self),self.wp) == FALSE) <-- copy string on stack
{
  AI_GotoWP(self,self.wp);
};

Finalize support for Rooms/Portals

Need to improve 'room' detection, so script api can work properly.
Offended api:

  • Wld_AssignRoomToGuild
  • Wld_GetPlayerPortalGuild
  • Npc_GetPortalGuild

For now implementation of Npc_GetPortalGuild reduced to GIL_NONE or GIL_PUBLIC.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.