First run problems, file types, OGG conversion


I have posted a series of posts in the Polish section, but apparently this is not where development takes place. The problems I discovered were threefold.

  1. It’s easy to screw up installation on Linux.
    I compiled vcmi as I usually compile programs:
# cmake ../vcmi
# make
# LD_LIBRARY_PATH=$VCMI_LIBS ./client/vcmiclient

That was a bad idea. At first run, the game didn’t copy “config” files (that happened to more people in that thread), leaving me confused: where should I get “config” from? Why isn’t the game searching for config in ~/.config/vcmi but in data directory instead?

I think it should be stressed in installation instructions/wiki:
If you don’t want to pollute your main system, use cmake’s prefix.

# cmake -DCMAKE_INSTALL_PREFIX=absolute_path_to_binaries ../vcmi
# make && make install
# cd absolute_path_to_binaries
# ./bin/vcmiclient

The above method may be uncomfortable for development, but it works.

It might be a good idea to warn the user if the game couldn’t find its files at first startup due to misconfigured paths.

  1. The game is limited to .mp3 and .ogg file extensions when it comes to audio. Wouldn’t it make modders’ lifes easier if the support was broader? SDL_mixer supports MODs, MIDI, WAV, FLAC formats and a few others. It’s a one-liner to add (flaky) support for those. I think the same should happen to other formats (video, archive, image) - why limit modders?

The long-term solution might be to use libmagic to figure out the MIME type of files not specific to VCMI instead of relying on file names. If there’s interest in that, I might try it myself.

  1. I use Fedora and SDL_mixer is compiled without MP3 suport. I don’t mind converting my files, but I don’t want my music to lose quality during the conversion. Original music is already 128Kb/s, so I have changed OGG to FLAC. FLAC files are 5x larger (414MiB) than original MP3, but I don’t think it matters if someone is using Fedora - i.e. desktop.

Patches are not allowed as attachments by the forum, so there it is:

Bonus bug report: with current git, building requirements are not shown after another building has been built in the same turn in the same city. The message is “can’t build” instead.

Haven’t I already implemented that? VCMI should search both path IIRC. If not - then this sounds like a bug.

Oh - and feel free to add some better tests for data presence. I would accept any patches/pulls for that, jsut keep in mind that such error messages should make sense on other platforms like Win (or be platform-specific)

Sounds OK. You can edit wiki yourself to make this clear (login with your forum account).

  1. I’d rather keep list of supported formats as small as possible. This is a game, not an image/sound editor. This also recudes likehood of issues like MP3’s on Fedora. On the other hand - addition of flac as lossless format for vcmi sounds OK.

Current solution is optimized for speed - we need to run search through 1000+ files and determine their type during loading. This is quite long already (~100-200 ms on my system). No need to make this even longer.

Main reasons behind that are:

  1. provide case-insensetive FS. This is how H3 works so we can’t d much here.
  2. Allow replacing (by mods for example) files of the same “type”. For example “garrison.png” will replace H3 file “garrison.pcx” but will not hide file “garrison.txt”.
  3. Don’t perform costly decompression - H3 uses compressed archives for game data. libmagic would need some decompression to get header for every file which we can’t afford.

As I said - I’m OK with addition of flac as “supported” but I’d rather leave script as it. Its main purpose is to provide as simple as possible way to install VCMI. Converting lossy mp3 to lossless flac won’t add much to game since quite few would notice effects of mp3->ogg conversion.

Sounds like a forum bug. Will add patch/diff to allowed extensions

In this case I’ll fork VCMI on github and make a pull request when I find the time. I’ll try to keep the code compatible with Windows, but I don’t currently have any easily-accessible Windows or Wine install.
If I get into VCMI more seriously, then I might set up a VM for this purpose :slight_smile: