Vega-strike-engine-source: When the Vega Strike engine fails to find the assets, the resulting error message is very unclear

Created on 7 Feb 2021  路  11Comments  路  Source: vegastrike/Vega-Strike-Engine-Source

We should have a clear, specific error message for this case.

bug

All 11 comments

Relates to #321
Relates to #417

We really should have this in 0.7.x so I'm going to try to work through it.

Okay so working through some code now to try to figure this out; prepped the CMake and docs to do two things:

  1. Install both vegastrike-engine and vegastrike binaries
  2. Updated the manpages for the delta between them
  3. Install man pages as both vegastrike.1 and vegastrike-engine.1

The difference between vegastrike and vegastrike-engine is that vegastrike-engine requires the data directory to be specified, while vegastrike continues with the legacy behavior.

As Cmake doesn't support symlinks it instead installs two copies of the same binary using both names. The code, however, checks hows it was called (in true Unix fashion) to decide which mode to operate in.

Still trying to figure out how to get it to behave as desired but the infrastructure is there to do it with minimal effort once I figure out the code.

Working on master but intending to backport these changes to 0.7.x after it's working.

Goal: Eventually turn over the vegastrike binary with it's legacy behavior to VS:UtCS Assets Package as a wrapper to vegastrike-engine. This is just the first step on the journey. If all goes well, PWCU could do a similar wrapper for their assets with their own desired binary name (privateer, pcwu, etc).

Vegastrike-engine is used for different datasets, so it needs to be told upon which data set to operate.
This is why we have been adding a small script to the data, to find and run the game in the proper context.

Running "vegastrike" on the command line should default to finding the vegastrike data, and operating on that. Currently, if the vegastrike data directory is not found, it has the unclear error message that is the cause of this report.

In my humble opinion, vegastrike should also look in it's config file, to see if the data directory is specified there, and failing that, should give an error message like:

No game data found.
Please specify where the data to load is located with "vegastrike -d[data_dir]" or run the script supplied with the game data.

How about if we keep this ticket just about the error message? And discuss separating the binaries, etc. on the respective tickets for those

@stephengtuggy the binary name change is nominal; catching the error properly is the more difficult issue. The name change is more to help start the differentiation process, but it kind of gets tied in here as it's an easy way to maintain the historic behavior while also adding the ability for the new behavior.

@BenjamenMeyer OK.

I believe the code you want to modify (at least part of it) is the function void InitDataDirectory(), in engine/src/vsfilesystem.cpp. If the binary name is vegastrike, then /usr/share/vegastrike should probably be added to the directory search list. If the binary name is vegastrike-engine, then the directory search list should be empty, requiring the data directory to be specified on the command line.

Sound good?

@stephengtuggy thanks for the tip.

All, please see #432 . Should cover Linux/Mac; documented what's needed for Win32 with a caveat that I'm not familiar with the directories that VS:UtCS uses on Windows.

432 fixes this on master

433 fixes this for 0.7.x

Fixed in #432 and #433

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nabaco picture nabaco  路  4Comments

BenjamenMeyer picture BenjamenMeyer  路  3Comments

viktorradnai picture viktorradnai  路  3Comments

royfalk picture royfalk  路  6Comments

BenjamenMeyer picture BenjamenMeyer  路  5Comments