VCMI crash trying to run with mac install data

Hello, I have copied the data and maps directories (to ~/Library/Application Support/vcmi) from an old mac os install of Heroes III (installed from originally purchased CD). However VCMI crashes at launch. I am using the latest VCMI version on macOS 11 (Big Sur).

Is there any way this could work? Or is it maybe that VCMI is somehow not compatible with the mac os install data files?

vmci - is it typo?

Sorry yes it’s a typo.

Here’s the crash information:

terminating with uncaught exception of type std::runtime_error: The end of the stream was reached unexpectedly. The stream has a length of 22899663 and the current reading position is 22899663. The client wanted to read 40 bytes.

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	0x00007fff2041190e __pthread_kill + 10
1   libsystem_pthread.dylib       	0x00007fff204405bd pthread_kill + 263
2   libsystem_c.dylib             	0x00007fff20395406 abort + 125
3   libc++abi.dylib               	0x00007fff20403ef2 abort_message + 241
4   libc++abi.dylib               	0x00007fff203f55e5 demangling_terminate_handler() + 242
5   libobjc.A.dylib               	0x00007fff202ee595 _objc_terminate() + 104
6   libc++abi.dylib               	0x00007fff20403307 std::__terminate(void (*)()) + 8
7   libc++abi.dylib               	0x00007fff20405beb __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 27
8   libc++abi.dylib               	0x00007fff20405bb2 __cxa_throw + 116
9   libvcmi.dylib                 	0x000000010da13ea3 CBinaryReader::read(unsigned char*, long long) + 115
10  libvcmi.dylib                 	0x000000010da0e1b5 CArchiveLoader::initVIDArchive(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, CFileInputStream&) + 197
11  libvcmi.dylib                 	0x000000010da0d420 CArchiveLoader::CArchiveLoader(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, boost::filesystem::path, bool) + 624
12  libvcmi.dylib                 	0x000000010da2210f void CFilesystemGenerator::loadArchive<(EResType::Type)11>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, JsonNode const&) + 399
13  libvcmi.dylib                 	0x000000010da2284b CFilesystemGenerator::loadConfig(JsonNode const&) + 539
14  libvcmi.dylib                 	0x000000010da24277 CResourceHandler::createFileSystem(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, JsonNode const&, bool) + 103
15  libvcmi.dylib                 	0x000000010da24048 CResourceHandler::load(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) + 408
16  eu.vcmi.vcmi                  	0x000000010d912094 MainWindow::load() + 340
17  eu.vcmi.vcmi                  	0x000000010d912ae3 MainWindow::MainWindow(QWidget*) + 99
18  eu.vcmi.vcmi                  	0x000000010d90bdec main + 44
19  libdyld.dylib                 	0x00007fff2045bf3d start + 1

I looked into the data directory for a file that would match the size mentioned in the crash log (22899663) and could not find a match, but there is a file named video.vid which is quite close → 22899949. Could be related.

I found another bigger file also named video.vid directly on the CD. Crashes also. I assume the smaller one installed on disk is a lighter version to save disk space while the bigger one was accessed on-demand from the CD while playing the game. I am not sure how to please vcmi with those two, I try to concat the smaller one + the bigger one into one file but crashes as well.

It’s been a while since somebody used CD data for vcmi…
So you have:

  • ~22 Mb-sized file in H3 install directory
  • ~600 Mb-sized file on CD. Correct?
  1. Can you upload smaller file somewhere so I can take a look on it?
  2. I assume using large file instead of a small one also leads to a crash?
  3. Can you try removing both files and run vcmi without video.vid files? You won’t have in-game videos but this is better than crash

Thank you, that’s exactly it. I’m not at my computer anymore but will try again later this week-end and report my findings. Everything I have tried so far leads to a crash, it seems vcmi expects a bigger file. I’ll also try to upload the files somewhere so you (and others) can see how they look.

FYI video.vid is optional, you can remove it if you don’t care about in-game videos

I tried removing video.vid and vcmi crashes again:

terminating with uncaught exception of type std::runtime_error: Resource with name DATA/TENTCOLR and type TEXT wasn't found.

Thread 15 Crashed:
0   libsystem_kernel.dylib        	0x00007fff2041190e __pthread_kill + 10
1   libsystem_pthread.dylib       	0x00007fff204405bd pthread_kill + 263
2   libsystem_c.dylib             	0x00007fff20395406 abort + 125
3   libc++abi.dylib               	0x00007fff20403ef2 abort_message + 241
4   libc++abi.dylib               	0x00007fff203f55e5 demangling_terminate_handler() + 242
5   libobjc.A.dylib               	0x00007fff202ee595 _objc_terminate() + 104
6   libc++abi.dylib               	0x00007fff20403307 std::__terminate(void (*)()) + 8
7   libc++abi.dylib               	0x00007fff20405beb __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 27
8   libc++abi.dylib               	0x00007fff20405bb2 __cxa_throw + 116
9   libvcmi.dylib                 	0x0000000110bf23fb CFilesystemList::load(ResourceID const&) const + 395
10  libvcmi.dylib                 	0x00000001110eda1d CLegacyConfigParser::CLegacyConfigParser(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) + 93
11  libvcmi.dylib                 	0x00000001110eefbc CGeneralTextHandler::readToVector(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 60
12  libvcmi.dylib                 	0x00000001110f1f27 CGeneralTextHandler::CGeneralTextHandler() + 5687
13  libvcmi.dylib                 	0x00000001111ee717 LibClasses::init(bool) + 215
14  vcmiclient                    	0x000000010e6d3311 init() + 33
15  libboost_thread.dylib         	0x0000000111862a32 boost::(anonymous namespace)::thread_proxy(void*) + 146
16  libsystem_pthread.dylib       	0x00007fff204408fc _pthread_start + 224
17  libsystem_pthread.dylib       	0x00007fff2043c443 thread_start + 15

VCMI needs “Shadow of Death” or “Heroes 3: Complete Edition”
This looks like “Restoration of Erathia”, which is not supported right now.

ah too bad, I was looking into replaying the same game I used to play all those years ago. The CD I have doesn’t have any name besides “Heroes of Might and Magic III”, I guess it’s an older version then. Thank you for your feedback.

By the way, if anyone of you would be interested in making this work. I can provide the game data for research & development.

Hi all! I too have encountered a problem running VCMI on my Mac and would like to share my experience. I was also getting an error when starting the game and found that it was related to the libSDL2-2.0.0.dylib file. To solve this problem, I did the following:
Downloaded the latest version of SDL2 from the official website.
I copied libSDL2-2.0.0.dylib from archive to /usr/local/lib/.
I ran the command sudo chmod 755 /usr/local/lib/libSDL2-2.0.0.dylib.
After that I was able to run VCMI successfully. I hope this helps someone to solve the problem of running the game on a Mac.

which error exactly and why do you think it was related to SDL?

prebuilt binaries are linked to SDL statically, you can also check that otool -L on the client executable doesn’t list libSDL2-2.0.0.dylib. So not sure what you were solving…

Out of curiosity, has anyone an estimate of what would be the amount of work required to make VCMI compatible with “Restoration of Erathia”? Are we talking new game logic across the engine, or adding the ability to turn off features in the engine that weren’t available in that version of the game? I’m a programmer myself (although not super proficient in C++).

Nothing complex, supporting RoE shouldn’t be too hard. Quick and hack-ish solution can probably be made in a few days, or in one-two weeks if you want proper solution (assuming familiarity with vcmi code).

If we had high-priority goal to make RoE work with VCMI it can be done quite quickly. All you need to do is implement option to turn off all features added in later editions & adapt code to slightly different files layout.

However right now this is rather low as far as priorities go. Our team is quite small at the moment and very few players have RoE edition. Most players already own latest edition (Shadow of Death / Complete) and this is also the only edition you can buy on gog.com so support fo RoE is something that rarely gets requested.

ok, so I’ve setup the whole thing to see if I can manage to do anything. But I am getting a different crash, possibly because I’m running off the develop branch.

Resource with name CONFIG/FILESYSTEM and type TEXT wasn't found

Any idea what to do with this?

VCMI requires ‘config’ and ‘Mods’ directory from source code to be available in one of data paths.
Data paths are different depending on OS, see lib/VCMIDirs.cpp
(or run vcmiclient --help to see these paths)

Thanks. I think I’m now reproducing the state I was in using the pre-built binary. I’ll poke around and report what I find.