Remaster Mod: cannot register member C_FIGHTAI.MOVE: incorrect number of elements: given 6 expected 7
The Remaster Mod fails to run on current builds, due to a bug in FightAI.
I suspect the mod uses the fight AI scripts differently than vanilla, because vanilla works fine. I can't see anything else unusual in the Mod content, it's basically just extra .mod files.
I've tried the steam workshop version, aswell as the lastest release on WoG, both with the same result.
OpenGothic v1.0 dev
[ALSOFT] (EE) Could not query RTKit: No such file or directory (2)
---crashlog(std::exception(cannot register member C_FIGHTAI.MOVE: incorrect number of elements: given 6 expected 7))---
GPU: AMD Radeon RX 7800 XT (RADV NAVI32)
#1: std::unexpected() - /usr/lib/gcc/x86_64-pc-linux-gnu/14/libstdc++.so.6(_ZSt10unexpectedv+0) [0x7f5bf8e9f636]
#2: std::unexpected() - /usr/lib/gcc/x86_64-pc-linux-gnu/14/libstdc++.so.6(+0xb6af7) [0x7f5bf8eb6af7]
#3: zenkit::DaedalusSymbol* zenkit::DaedalusScript::_check_member<zenkit::FightAiMove, 6>(std::basic_string_view<char, std::char_traits<char> >, std::type_info const*) - /home/thomasg/sources/OpenGothic/build/opengothic/Gothic2Notr(_ZN6zenkit14DaedalusScript13_check_memberINS_11FightAiMoveELi6EEEPNS_14DaedalusSymbolESt17basic_string_viewIcSt11char_traitsIcEEPKSt9type_info+0x20f) [0x55c1087bd6ef]
#4: zenkit::IFightAi::register_(zenkit::DaedalusScript&) - /home/thomasg/sources/OpenGothic/build/opengothic/Gothic2Notr(_ZN6zenkit8IFightAi9register_ERNS_14DaedalusScriptE+0x53) [0x55c1087b3873]
#5: zenkit::register_all_script_classes(zenkit::DaedalusScript&) - /home/thomasg/sources/OpenGothic/build/opengothic/Gothic2Notr(_ZN6zenkit27register_all_script_classesERNS_14DaedalusScriptE+0x278) [0x55c1087bc0e8]
#6: Gothic::createPhoenixVm(std::basic_string_view<char, std::char_traits<char> >, ScriptLang) - /home/thomasg/sources/OpenGothic/build/opengothic/Gothic2Notr(_ZN6Gothic15createPhoenixVmESt17basic_string_viewIcSt11char_traitsIcEE10ScriptLang+0x3e) [0x55c10867a15e]
#7: FightAi::FightAi() - /home/thomasg/sources/OpenGothic/build/opengothic/Gothic2Notr(_ZN7FightAiC1Ev+0x58) [0x55c1085e3828]
#8: Gothic::setupGlobalScripts() - /home/thomasg/sources/OpenGothic/build/opengothic/Gothic2Notr(_ZN6Gothic18setupGlobalScriptsEv+0x2a) [0x55c10867063a]
#9: main - /home/thomasg/sources/OpenGothic/build/opengothic/Gothic2Notr(main+0x21a) [0x55c108591b5a]
I was able to narrow down the issue to the Balance mod, which is included in most variants of Remaster. All other remaster .mod files shipped within their exe installer do load, it only fails in Remaster_Balance.mod (the steam version includes this in a single .mod file).
Hi, @tg-- and thanks for report!
C_FIGHTAI.MOVE: incorrect number of elements: given 6 expected 7
This is somewhat common bug in various mods, caused by mod author declares more "fight-moves", for fighting ai, than allowed by engine. Vanilla never checks such things, allowing essentially memory corruption. In OpenGothic we not allowing for script to do such things.
May you provide a download link to mod (Remaster_Balance should be enough), so I can start look into possible workarounds? Thanks!
I have encountered the same issue last week.
- Mod download page: https://www.worldofgothic.de/dl/download_667.htm
- Direct mod download: https://www.worldofgothic.de/download.php?id=1647
Minimod Balance standalone is here:
- https://www.worldofgothic.de/dl/download_208.htm
- https://www.worldofgothic.de/download.php?id=629
The EXE can simply be unpacked with 7z (you probably knew that, I didn't ;) to get the mod files without running the installer.
After installing G2_Gold_Remaster_v2.5_Multilanguage.exe, and adjusting the mod ini (see #737):
diff --git a/system/Remaster.ini b/system/Remaster.ini
index a3e1ff6..bbb5915 100644
--- a/system/Remaster.ini
+++ b/system/Remaster.ini
@@ -8,8 +8,8 @@ Icon=Remaster.ico
[FILES]
VDF=Remaster_Worlds.mod Remaster_Graphics.mod Remaster_Plants.mod Remaster_Balance.mod
-Game=Content\Gothic
-FightAI=Content\Fight
+Game=Gothic
+FightAI=Fight
Menu=System\Menu
Camera=System\Camera
Music=System\Music
The game still fails to start:
---crashlog(SIGSEGV)---
GPU: Intel(R) Graphics (RPL-P)
#1: PackedMesh::PackedMesh(zenkit::SoftSkinMesh const&) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN10PackedMeshC1ERKN6zenkit12SoftSkinMeshE+0x170) [0x5a91057f3380]
#2: ProtoMesh::ProtoMesh(zenkit::ModelMesh const&, std::unique_ptr<Skeleton, std::default_delete<Skeleton> >&&, std::basic_string_view<char, std::char_traits<char> >) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN9ProtoMeshC1ERKN6zenkit9ModelMeshEOSt10unique_ptrI8SkeletonSt14default_deleteIS5_EESt17basic_string_viewIcSt11char_traitsIcEE+0x8aa) [0x5a91057e548a]
#3: Resources::implLoadMeshMain(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN9Resources16implLoadMeshMainENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x95e) [0x5a9105849ace]
#4: Resources::implLoadMesh(std::basic_string_view<char, std::char_traits<char> >) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN9Resources12implLoadMeshESt17basic_string_viewIcSt11char_traitsIcEE+0x19f) [0x5a910584a2cf]
#5: Resources::loadMesh(std::basic_string_view<char, std::char_traits<char> >) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN9Resources8loadMeshESt17basic_string_viewIcSt11char_traitsIcEE+0x3c) [0x5a910584a4ec]
#6: WorldView::addView(std::basic_string_view<char, std::char_traits<char> >, int, int, int) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN9WorldView7addViewESt17basic_string_viewIcSt11char_traitsIcEEiii+0x25) [0x5a9105829305]
#7: World::addView(std::basic_string_view<char, std::char_traits<char> >, int, int, int) const - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZNK5World7addViewESt17basic_string_viewIcSt11char_traitsIcEEiii+0x2d) [0x5a91058c5ecd]
#8: Npc::setVisualBody(int, int, int, int, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN3Npc13setVisualBodyEiiiiSt17basic_string_viewIcSt11char_traitsIcEES3_+0x2c2) [0x5a91058a3f52]
#9: GameScript::mdl_setvisualbody(std::shared_ptr<zenkit::INpc>, std::basic_string_view<char, std::char_traits<char> >, int, int, std::basic_string_view<char, std::char_traits<char> >, int, int, int) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN10GameScript17mdl_setvisualbodyESt10shared_ptrIN6zenkit4INpcEESt17basic_string_viewIcSt11char_traitsIcEEiiS7_iii+0x52) [0x5a910571deb2]
#10: std::_Function_handler<void (std::shared_ptr<zenkit::INpc>, std::basic_string_view<char, std::char_traits<char> >, int, int, std::basic_string_view<char, std::char_traits<char> >, int, int, int), GameScript::bindExternal<void (GameScript::*)(std::shared_ptr<zenkit::INpc>, std::basic_string_view<char, std::char_traits<char> >, int, int, std::basic_string_view<char, std::char_traits<char> >, int, int, int)>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, void (GameScript::*)(std::shared_ptr<zenkit::INpc>, std::basic_string_view<char, std::char_traits<char> >, int, int, std::basic_string_view<char, std::char_traits<char> >, int, int, int))::{lambda((auto:1)...)#1}>::_M_invoke(std::_Any_data const&, std::shared_ptr<zenkit::INpc>&&, std::basic_string_view<char, std::char_traits<char> >&&, int&&, int&&, std::basic_string_view<char, std::char_traits<char> >&&, int&&, int&&, int&&) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZNSt17_Function_handlerIFvSt10shared_ptrIN6zenkit4INpcEESt17basic_string_viewIcSt11char_traitsIcEEiiS7_iiiEZN10GameScript12bindExternalIMS9_FvS3_S7_iiS7_iiiEEEvRKNSt7__cxx1112basic_stringIcS6_SaIcEEET_EUlDpT_E_E9_M_invokeERKSt9_Any_dataOS3_OS7_OiST_SS_ST_ST_ST_+0xb4) [0x5a9105746d14]
#11: std::_Function_handler<void (zenkit::DaedalusVm&), zenkit::DaedalusVm::register_external<void, std::shared_ptr<zenkit::INpc>, std::basic_string_view<char, std::char_traits<char> >, int, int, std::basic_string_view<char, std::char_traits<char> >, int, int, int>(std::basic_string_view<char, std::char_traits<char> >, std::function<void (std::shared_ptr<zenkit::INpc>, std::basic_string_view<char, std::char_traits<char> >, int, int, std::basic_string_view<char, std::char_traits<char> >, int, int, int)> const&)::{lambda(zenkit::DaedalusVm&)#1}>::_M_invoke(std::_Any_data const&, zenkit::DaedalusVm&) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZNSt17_Function_handlerIFvRN6zenkit10DaedalusVmEEZNS1_17register_externalIvJSt10shared_ptrINS0_4INpcEESt17basic_string_viewIcSt11char_traitsIcEEiiSB_iiiEEEvSB_RKSt8functionIFT_DpT0_EEEUlS2_E_E9_M_invokeERKSt9_Any_dataS2_+0x171) [0x5a9105755a51]
#12: zenkit::DaedalusVm::exec() - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN6zenkit10DaedalusVm4execEv+0x5e5) [0x5a9105914af5]
#13: zenkit::DaedalusVm::unsafe_call(zenkit::DaedalusSymbol const*) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN6zenkit10DaedalusVm11unsafe_callEPKNS_14DaedalusSymbolE+0x28) [0x5a9105915238]
#14: zenkit::DaedalusVm::exec() - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN6zenkit10DaedalusVm4execEv+0xac9) [0x5a9105914fd9]
#15: zenkit::DaedalusVm::unsafe_call(zenkit::DaedalusSymbol const*) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN6zenkit10DaedalusVm11unsafe_callEPKNS_14DaedalusSymbolE+0x28) [0x5a9105915238]
#16: GameScript::initializeInstanceNpc(std::shared_ptr<zenkit::INpc> const&, unsigned long) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN10GameScript21initializeInstanceNpcERKSt10shared_ptrIN6zenkit4INpcEEm+0x15c) [0x5a910572fc4c]
#17: Npc::Npc(World&, unsigned long, std::basic_string_view<char, std::char_traits<char> >, Npc::ProcessPolicy) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN3NpcC1ER5WorldmSt17basic_string_viewIcSt11char_traitsIcEENS_13ProcessPolicyE+0x50d) [0x5a91058a49bd]
#18: WorldObjects::addNpc(unsigned long, std::basic_string_view<char, std::char_traits<char> >) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN12WorldObjects6addNpcEmSt17basic_string_viewIcSt11char_traitsIcEE+0x78) [0x5a91058d2318]
#19: GameScript::wld_insertnpc(int, std::basic_string_view<char, std::char_traits<char> >) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN10GameScript13wld_insertnpcEiSt17basic_string_viewIcSt11char_traitsIcEE+0x1b) [0x5a9105721adb]
#20: std::_Function_handler<void (zenkit::DaedalusVm&), zenkit::DaedalusVm::register_external<void, int, std::basic_string_view<char, std::char_traits<char> > >(std::basic_string_view<char, std::char_traits<char> >, std::function<void (int, std::basic_string_view<char, std::char_traits<char> >)> const&)::{lambda(zenkit::DaedalusVm&)#1}>::_M_invoke(std::_Any_data const&, zenkit::DaedalusVm&) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZNSt17_Function_handlerIFvRN6zenkit10DaedalusVmEEZNS1_17register_externalIvJiSt17basic_string_viewIcSt11char_traitsIcEEEEEvS8_RKSt8functionIFT_DpT0_EEEUlS2_E_E9_M_invokeERKSt9_Any_dataS2_+0x60) [0x5a910573e380]
#21: zenkit::DaedalusVm::exec() - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN6zenkit10DaedalusVm4execEv+0x5e5) [0x5a9105914af5]
#22: zenkit::DaedalusVm::unsafe_call(zenkit::DaedalusSymbol const*) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN6zenkit10DaedalusVm11unsafe_callEPKNS_14DaedalusSymbolE+0x28) [0x5a9105915238]
#23: zenkit::DaedalusVm::exec() - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN6zenkit10DaedalusVm4execEv+0xac9) [0x5a9105914fd9]
#24: zenkit::DaedalusVm::unsafe_call(zenkit::DaedalusSymbol const*) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN6zenkit10DaedalusVm11unsafe_callEPKNS_14DaedalusSymbolE+0x28) [0x5a9105915238]
#25: zenkit::DaedalusVm::unsafe_call(zenkit::DaedalusSymbol const*) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(+0x2322f8) [0x5a910577f2f8]
#26: GameSession::initScripts(bool) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN11GameSession11initScriptsEb+0x21c) [0x5a910578023c]
#27: GameSession::GameSession(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(_ZN11GameSessionC1ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x238) [0x5a9105780788]
#28: GameSession::GameSession(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(+0x2e1df8) [0x5a910582edf8]
#29: GameSession::GameSession(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) - /home/versable/Documents/git/OpenGothic/build/opengothic/Gothic2Notr(+0x250bd5) [0x5a910579dbd5]
#30: GameSession::GameSession(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) - /lib/x86_64-linux-gnu/libstdc++.so.6(+0xecdb4) [0x7a28a7eecdb4]
#31: GameSession::GameSession(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) - /lib/x86_64-linux-gnu/libc.so.6(+0x9caa4) [0x7a28a7a9caa4]
#32: GameSession::GameSession(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) - /lib/x86_64-linux-gnu/libc.so.6(+0x129c3c) [0x7a28a7b29c3c]
As always, thanks @Try
NOTE: Removing the Remaster_Balance.mod file does not make a difference
Running in graphics mode (only with Remaster_Graphics.vdf) seem fine:
For full mod, I have has to stitch together versions from worldofgothic.de and steam. Only wog is not enough - it missing Gothic.dat - no scripts to run the game at all.
So I've added Gold_Remaster_Balance_en.mod and Gold_Remaster_Balance.mod from steam.
Also have had to bump IFightAi::move_count to 7 - this is a common bug for many mods out there.
Quite a Frankenstein...
Also have had to bump IFightAi::move_count to 7 - this is a common bug for many mods out there.
This part should work now
Gold remaster now runs for me locally.