try / opengothic Goto Github PK
View Code? Open in Web Editor NEWReimplementation of Gothic 2 Notr
License: MIT License
Reimplementation of Gothic 2 Notr
License: MIT License
It was impossible, in original game, to block monster attack, by using Action+Back key-combinations.
For now game font menu.ttf/main.ttf have no support for non-english letters.
Workaround: replace font files
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?!
};
};
This is to track the Linux issue I found where with the X11 improvements (Try/Tempest#8), the mouse camera only goes left and right, instead of along with up and down. You can assign that to me if you'd like, and I'll research what could be happening.
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:
I want to offer you the following changes, but want to ask for your opinions beforehand:
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 👍
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.
Right now make install
completely fails for a number of reasons:
install
macro for the Gothic2Notr
binary is missing so the binary doesn't get installed at allinstall
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.
It seems trigger event GregIsBack_S1 is never called
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.
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
Dialog with them never starts automatically.
script:
EnglishCleanedScripts/Content/Story/Dialog_Mobsis/B_RefuseAction.d
Hey there,
wanted to try youre opengothic implementation on linux with gothic 2 gold steam. I am using the latest opengothic that compiled on linux. By the way great project didnt know this exists.
Need to improve 'room' detection, so script api can work properly.
Offended api:
For now implementation of Npc_GetPortalGuild reduced to GIL_NONE or GIL_PUBLIC.
WorldScript::loadDialogOU still use acii path to dialogs file
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.
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:
Greets
---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
Since all Npc::drawWeapon* can failed for variety of reasons, need to change design of:
Testcase: Stoneguardian_Ornament, in NOTR
Current implementation of Hlp_GetNpc is just bad: not performing search at all.
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
Have to null all .instanceDataHandle references to C_Npc/C_Item, upon deleting
Most likely something wring with animation-skeletion.
Engine always use a "ZS_SWORD" bone-socket to emplace one-handled weapons. Somethings goes wrong...
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
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
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
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?
Right now game expect to find shaders, fonts at "./data/*" - need to detect self-directory for *.exe location.
I'm wondering if cross-platform support is planed for the future, in particular if this should run in Linux.
Thanks!
In "Night of the Raven", there was a behavior change for AI-State scripts.
Tests cases: ZS_DEATH; ZS_GETMEAT
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
...
};
};
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.
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);
};
I tried to debug it some time now, but this seems to be a bit tricky.
So here are the infos I got:
Not easy to find, but it smells like a race condition, or ?
I'll continue searching, but maybe you already have an idea.
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.
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.
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,"");
};
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.