vegastrike / Vega-Strike-Engine-Source

Vega Strike Engine
Other
260 stars 44 forks source link

Crash on startup #894

Open evertvorster opened 1 month ago

evertvorster commented 1 month ago

Hi there!

Just taking the new vegastrike for a spin, and unfortunately it does not start up.

Console output when starting the game:

Starting Vega Strike...

Registering codec ogg
.
Legacy Mode: TRUE
Saving current directory (/home/evert/.vegastrike) as DATA_DIR
 In path /home/evert/.vegastrike
Vega Strike  
See http://www.gnu.org/copyleft/gpl.html for license details.

ARG #1 = -d/usr/share/vegastrike
Using data dir specified on command line : /usr/share/vegastrike
GOT SUBDIR ARG = 
Found data in /usr/share/vegastrike
Using /usr/share/vegastrike as data directory
Using .vegastrike as the home directory
Found MODDIR = /usr/share/vegastrike/mods
USING HOMEDIR : /home/evert/.vegastrike As the home directory 
CONFIGFILE - Found a config file in home directory, using : /home/evert/.vegastrike/vegastrike.config
LoadGameConfig: Found game config at '/home/evert/.vegastrike/vegastrike.config'
LoadXML called with filename '/home/evert/.vegastrike/vegastrike.config'
DATADIR - No datadir specified in config file, using : /usr/share/vegastrike
Force galaxy to /usr/share/vegastrike/universe/milky_way.xml
SIMULATION_ATOM: 0.01
terminate called after throwing an instance of 'json::parsing_error'
  what():  Input is not a valid object
/usr/bin/vs: line 28: 92023 Aborted                 (core dumped) vegastrike -d"${VEGASTRIKE_SHARE_DIR}" "$1"

In preparation for the running of this game, I built Assets and the game engine from the latest git master. (2024-10-16) Then installed them.

One other thing I noticed is that the part of the config file where you specify a monitor to start up on gets erased when you install Assets and the engine. I do believe I opened an Issue against Assets or Assets Master for this. But that is besides the point. Right now, the game does not even launch. Could it be possible that a change was made to the local Assets on your development machine that was not also made in Assets?

Anyways, about my system:

Operating System: Arch Linux 
KDE Plasma Version: 6.2.1
KDE Frameworks Version: 6.7.0
Qt Version: 6.8.0
Kernel Version: 6.11.1-arch1-1.1-g14 (64-bit)
Graphics Platform: X11
Processors: 32 × AMD Ryzen 9 7945HX3D with Radeon Graphics
Memory: 62.0 GiB of RAM
Graphics Processor: AMD Radeon 610M
Manufacturer: ASUSTeK COMPUTER INC.
Product Name: ROG Strix G733PYV_G733PYV
System Version: 1.0
royfalk commented 1 month ago

Sorry. I suspect this is an issue where the engine PR went through and the asset PR is still pending. Take a look at https://github.com/vegastrike/Assets-Production/pull/128 for the missing file in question.

I have a second PR in the works that also makes the game more resilient to missing files. The thing is, I think the game is crashing on another, valid JSON file that has some missing attributes like you thought. Otherwise it would have crashed with a segmentation fault and not an exception.

Can you run coredumpctl -1 gdb and then bt 10. That should help me understand the file in question. just dump the result in here.

royfalk commented 1 month ago

One other thing I noticed is that the part of the config file where you specify a monitor to start up on gets erased when you install Assets and the engine.

Is it really getting erased or is it ignored? I pushed a change that introduces a new config.json file. (See #128 above). The engine now takes the data from it for graphics. Over the next few weeks/months I'll transfer the rest of the config, minus the stuff that isn't used and reorganize it to something saner.

Sane means all the esoteric settings that are used will be pushed to an Advanced section, leaving something players can actually hack.

royfalk commented 1 month ago

I apologize for the inconvenience.

evertvorster commented 1 month ago

No worries. You pointed out the correct file, and when config.json is present in the install location, VegaStrike runs properly. I have not tested beyond just firing up the game and getting a game menu, though.

Unfortunately, just adding in the config.json is not enough, it also need to be mentioned in CMakeLists.txt so that it gets installed with the other game files. Once that is done, it would make sense to get that pull request to Assets applied so that this problem goes away.

This does point to another issue that might be a little tricky to solve, except with policy. When there is a pull request in the engine that relies on a change in assets, they need to be reviewed and applied together. From my side I made it easier in Arch to modify the AUR packages to test pull requests, so I will be able to help out with reviews of the pull requests before they git master.

royfalk commented 1 month ago

it also need to be mentioned in CMakeLists.txt

I was not aware of that. I'll do that.

...they need to be reviewed and applied together.

That's a good idea. I'll think I'll adopt that policy.