Vega-strike-engine-source: PWCU + Vega Strike (Py3)

Created on 10 Jun 2021  路  2Comments  路  Source: vegastrike/Vega-Strike-Engine-Source

PWCU Assets cause the vegastrike-engine to crash on load.

$ ./vegastrike-engine -d~/Devel/opensource/vegastrike/assets/privateer_wcu
[2021-06-09 19:45:18.352662] [0x00007fa90af64800] [trace]   Registering codec ogg
[2021-06-09 19:45:18.352706] [0x00007fa90af64800] [trace]   .

Legacy Mode: FALSE
 In path ~/Devel/opensource/vegastrike/Vega-Strike-Engine-Source/py3/build-0.8.x
Vega Strike  
See http://www.gnu.org/copyleft/gpl.html for license details.

ARG #1 = -d~/Devel/opensource/vegastrike/assets/privateer_wcu
Using data dir specified on command line : ~/Devel/opensource/vegastrike/assets/privateer_wcu
GOT SUBDIR ARG = 
Found data in ~/Devel/opensource/vegastrike/assets/privateer_wcu
Using ~/Devel/opensource/vegastrike/assets/privateer_wcu as data directory
Using .pu as the home directory
Found MODDIR = ~/Devel/opensource/vegastrike/assets/privateer_wcu/mods
USING HOMEDIR : ~/.pu As the home directory 
CONFIGFILE - No config found in home : ~/.pu/vegastrike.config
CONFIGFILE - No home config file found, using datadir config file : ~/Devel/opensource/vegastrike/assets/privateer_wcu/vegastrike.config
DATADIR - No datadir specified in config file
Force galaxy to ~/Devel/opensource/vegastrike/assets/privateer_wcu/universe/wcuniverse.xml
SIMULATION_ATOM: 0.06
['/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload']
['', '~/Devel/opensource/vegastrike/assets/privateer_wcu/modules/builtin', '~/Devel/opensource/vegastrike/assets/privateer_wcu/modules/quests', '~/Devel/opensource/vegastrike/assets/privateer_wcu/modules/missions', '~/Devel/opensource/vegastrike/assets/privateer_wcu/modules/ai', '~/Devel/opensource/vegastrike/assets/privateer_wcu/modules', '~/Devel/opensource/vegastrike/assets/privateer_wcu/bases', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload']
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
Floating point exception (core dumped)
bug

All 2 comments

I think I've pinpointed the problem:

Due to the slower pace and smaller in-system distances of the OG Privateer game, PWCU uses a physics game_speed of 0.2 instead of 1.0.

  • When I set game_speed to 0.2 I get an Arithmetic Exception during load.
  • When I set game_speed to 1.0 I make it to the loading screen.

The preliminary conclusion is that this has got to be some sort of regression?

EDIT: I took a look at the line in the code that is the apparent source of the exception and noticed that it is using integers and not floating point numbers, suggesting that this is a type-conversion snafu?

sec = GameConfig::GetVariable( "graphics", "insys_jump_ani_second_ahead", 4) / (GameConfig::GetVariable( "physics", "game_speed", 1) * GameConfig::GetVariable( "physics", "game_accel", 1));

The sec variable is initialised to 0.0f (32-bit float IIUC), but the expression contains references to both game_speed and game_accel, both of which were set to a default of 1 (int)?

I tried changing the default to a floating point number in the code (1 -> 1.0f), which successfully did away with the arithmetic exception even when using a game_speed of 0.2 in pwcu's vegastrike.config again.

This suggests that the variables were previously coerced to type int, where the value of 0.2 would have been rounded to 0, thus resulting in a _divide-by-zero_ condition, hence the arithmetic exception?

Patch attached below.

@BenjamenMeyer Could you perhaps try applying the attached patch on your end and see if it fixes it for you too? The patch was created on/from the 0.8.x branch FYI and I had to add a .txt extension for GH to accept it as a valid file. :roll_eyes:

pwcu_arithmetic_exception_on_load_fix.patch.txt

@ermo I'll give it a shot; but it might not be until Sunday.

UPDATE - 2021-07-09: sorry things have gotten a bit away from me with a lot of IRL work (house, garage, etc) popping up.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BenjamenMeyer picture BenjamenMeyer  路  4Comments

stephengtuggy picture stephengtuggy  路  3Comments

nabaco picture nabaco  路  3Comments

nabaco picture nabaco  路  4Comments

royfalk picture royfalk  路  6Comments