NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.1k stars 12.69k forks source link

rbdoom-3-bfg: Crash on startup with GOG version #236005

Open aidalgol opened 12 months ago

aidalgol commented 12 months ago

Describe the bug

RBDoom3BFG crashes early on during the Initializing Render Shaders stage, with the following error:

Created Vulkan device: NVIDIA GeForce RTX 3080
----- Initializing Render Shaders -----
Sys_Error: Couldn't read the binary file for shader renderprogs2/spirv/builtin/gui.vs.bin

Steps To Reproduce

Steps to reproduce the behavior:

  1. Download the GOG Windows installer from your GOG library
    • setup_doom_3_bfg_1.14_(13452).exe
    • setup_doom_3_bfg_1.14_(13452)-1.bin
  2. Extract the game from the installer. innoextract --gog -m /path/to/setup_doom_3_bfg_1.14_(13452).exe
  3. cd app
  4. Run RBDoom3BFG

Expected behavior

The game to launch successfully to the starting menu.

Additional context

Add any other context about the problem here.

❯ innoextract --version
innoextract 1.9
Extracts installers created by Inno Setup 1.2.10 to 6.0.5

Running on an nvidia 3080.

Contents of `app` directory | name | type | size | | ------------------------- | ---- | -------- | | Doom3BFG.exe | file | 5.2 MB | | Galaxy.dll | file | 4.4 MB | | GalaxyWrp.dll | file | 278.0 KB | | __support | dir | 4 B | | base | dir | 31 B | | binkw32.dll | file | 227.3 KB | | goggame-1135892318.hashdb | file | 13.6 KB | | goggame-1135892318.ico | file | 80.5 KB | | goggame-1135892318.info | file | 1.1 KB | | goggame-1135892318.script | file | 901 B | | language_setup.exe | file | 3.0 MB | | language_setup.ini | file | 634 B | | language_setup.png | file | 30.3 KB | | libfreespace.dll | file | 60.4 KB | | webcache.zip | file | 251.7 KB |
Contents of `base` directory | name | type | size | | ---------------------- | ---- | -------- | | _common.crc | file | 9.1 KB | | _common.resources | file | 80.4 MB | | _ordered.crc | file | 5.4 KB | | _ordered.resources | file | 11.3 MB | | _sound_pc.crc | file | 19.1 KB | | _sound_pc.resources | file | 545.9 MB | | _sound_pc_en.crc | file | 3.4 KB | | _sound_pc_en.resources | file | 134.0 MB | | _sound_pc_fr.crc | file | 3.3 KB | | _sound_pc_fr.resources | file | 130.4 MB | | _sound_pc_gr.crc | file | 3.3 KB | | _sound_pc_gr.resources | file | 136.1 MB | | _sound_pc_it.crc | file | 3.3 KB | | _sound_pc_it.resources | file | 128.8 MB | | _sound_pc_jp.crc | file | 3.3 KB | | _sound_pc_jp.resources | file | 138.7 MB | | _sound_pc_sp.crc | file | 3.3 KB | | _sound_pc_sp.resources | file | 126.6 MB | | classicmusic | dir | 4 B | | default.cfg | file | 1.4 KB | | joy_360_0.cfg | file | 621 B | | joy_360_1.cfg | file | 621 B | | joy_lefty.cfg | file | 382 B | | joy_righty.cfg | file | 382 B | | maps | dir | 122 B | | sound | dir | 3 B | | strings | dir | 8 B | | video | dir | 19 B | | wads | dir | 5 B |
Full console output In this run, the contents `app` directory extracted from the GOG were moved to `/extrapool/aidan/native-games/doom3-bfg/`. ```console ❯ RBDoom3BFG QA Timing INIT: 000187ms RBDOOM 3 BFG 1.5.0.1401 linux-x86_64 Jan 1 1980 00:00:00 found interface lo - loopback found interface enp5s0 - 192.168.1.240/255.255.255.0 no 'base' directory in exe path /nix/store/h1w3zx9k8nv5whny6cjwh2wrkfnvaj44-rbdoom-3-bfg-1.5.0/bin, skipping ------ Initializing File System ------ Loaded resource file _common.resources Loaded resource file _ordered.resources Loaded resource file _sound_pc.resources Loaded resource file _sound_pc_en.resources Loaded resource file _sound_pc_fr.resources Loaded resource file _sound_pc_gr.resources Loaded resource file _sound_pc_it.resources Loaded resource file _sound_pc_jp.resources Loaded resource file _sound_pc_sp.resources Loaded resource file maps/admin.resources Loaded resource file maps/alphalabs1.resources Loaded resource file maps/alphalabs2.resources Loaded resource file maps/alphalabs3.resources Loaded resource file maps/alphalabs4.resources Loaded resource file maps/caverns1.resources Loaded resource file maps/caverns2.resources Loaded resource file maps/comm1.resources Loaded resource file maps/commoutside.resources Loaded resource file maps/cpu.resources Loaded resource file maps/cpuboss.resources Loaded resource file maps/d3ctf1.resources Loaded resource file maps/d3ctf2.resources Loaded resource file maps/d3ctf3.resources Loaded resource file maps/d3ctf4.resources Loaded resource file maps/d3dm1.resources Loaded resource file maps/d3dm2.resources Loaded resource file maps/d3dm3.resources Loaded resource file maps/d3dm4.resources Loaded resource file maps/d3dm5.resources Loaded resource file maps/d3xpdm1.resources Loaded resource file maps/d3xpdm2.resources Loaded resource file maps/d3xpdm3.resources Loaded resource file maps/d3xpdm4.resources Loaded resource file maps/delta1.resources Loaded resource file maps/delta2a.resources Loaded resource file maps/delta2b.resources Loaded resource file maps/delta3.resources Loaded resource file maps/delta4.resources Loaded resource file maps/delta5.resources Loaded resource file maps/deltax.resources Loaded resource file maps/enpro.resources Loaded resource file maps/erebus1.resources Loaded resource file maps/erebus2.resources Loaded resource file maps/erebus3.resources Loaded resource file maps/erebus4.resources Loaded resource file maps/erebus5.resources Loaded resource file maps/erebus6.resources Loaded resource file maps/hell.resources Loaded resource file maps/hell1.resources Loaded resource file maps/hellhole.resources Loaded resource file maps/le_enpro1.resources Loaded resource file maps/le_enpro2.resources Loaded resource file maps/le_exis1.resources Loaded resource file maps/le_exis2.resources Loaded resource file maps/le_hell.resources Loaded resource file maps/le_hell_post.resources Loaded resource file maps/le_underground.resources Loaded resource file maps/le_underground2.resources Loaded resource file maps/mars_city1.resources Loaded resource file maps/mars_city2.resources Loaded resource file maps/mc_underground.resources Loaded resource file maps/monorail.resources Loaded resource file maps/phobos1.resources Loaded resource file maps/phobos2.resources Loaded resource file maps/phobos3.resources Loaded resource file maps/phobos4.resources Loaded resource file maps/recycling1.resources Loaded resource file maps/recycling2.resources Loaded resource file maps/site3.resources Current search path: /home/aidan/.local/share/rbdoom3bfg/base /extrapool/aidan/native-games/doom3-bfg/base _common.resources _ordered.resources _sound_pc.resources _sound_pc_en.resources _sound_pc_fr.resources _sound_pc_gr.resources _sound_pc_it.resources _sound_pc_jp.resources _sound_pc_sp.resources maps/admin.resources maps/alphalabs1.resources maps/alphalabs2.resources maps/alphalabs3.resources maps/alphalabs4.resources maps/caverns1.resources maps/caverns2.resources maps/comm1.resources maps/commoutside.resources maps/cpu.resources maps/cpuboss.resources maps/d3ctf1.resources maps/d3ctf2.resources maps/d3ctf3.resources maps/d3ctf4.resources maps/d3dm1.resources maps/d3dm2.resources maps/d3dm3.resources maps/d3dm4.resources maps/d3dm5.resources maps/d3xpdm1.resources maps/d3xpdm2.resources maps/d3xpdm3.resources maps/d3xpdm4.resources maps/delta1.resources maps/delta2a.resources maps/delta2b.resources maps/delta3.resources maps/delta4.resources maps/delta5.resources maps/deltax.resources maps/enpro.resources maps/erebus1.resources maps/erebus2.resources maps/erebus3.resources maps/erebus4.resources maps/erebus5.resources maps/erebus6.resources maps/hell.resources maps/hell1.resources maps/hellhole.resources maps/le_enpro1.resources maps/le_enpro2.resources maps/le_exis1.resources maps/le_exis2.resources maps/le_hell.resources maps/le_hell_post.resources maps/le_underground.resources maps/le_underground2.resources maps/mars_city1.resources maps/mars_city2.resources maps/mc_underground.resources maps/monorail.resources maps/phobos1.resources maps/phobos2.resources maps/phobos3.resources maps/phobos4.resources maps/recycling1.resources maps/recycling2.resources maps/site3.resources file system initialized. -------------------------------------- WARNING: Unable to open resource file maps/_startup.resources ----- Initializing Decls ----- ------------------------------ Couldn't open journal files /proc/cpuinfo CPU processors: 16 /proc/cpuinfo CPU logical cores: 32 execing default.cfg couldn't exec D3BFGConfig.cfg couldn't exec autoexec.cfg ----- R_InitOpenGL ----- Initializing Vulkan subsystem Enabled Vulkan instance extensions: VK_EXT_debug_utils VK_KHR_xlib_surface VK_KHR_surface VK_KHR_get_physical_device_properties2 Enabled Vulkan layers: Enabled Vulkan device extensions: VK_NV_mesh_shader VK_KHR_fragment_shading_rate VK_KHR_buffer_device_address VK_EXT_descriptor_indexing VK_KHR_maintenance1 VK_KHR_synchronization2 VK_KHR_swapchain Created Vulkan device: NVIDIA GeForce RTX 3080 ----- Initializing Render Shaders ----- Sys_Error: Couldn't read the binary file for shader renderprogs2/spirv/builtin/gui.vs.bin ```

Notify maintainers

@Zaechus

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

❯ nix shell nixpkgs#nix-info -c nix-info -m
 - system: `"x86_64-linux"`
 - host os: `Linux 6.2.16, NixOS, 23.11 (Tapir), 23.11.20230524.f91ee30`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.3`
 - channels(aidan): `"nixpkgs"`
 - channels(root): `"nixos"`
 - nixpkgs: `/home/aidan/.nix-defexpr/channels/nixpkgs`
oscen0 commented 7 months ago

I had to symlink /usr/share/doom3bfg/base/renderprogs2 into ~/.local/share/doom3bfg/base/renderprogs2 to make it work. I think it used to just have /usr/share/doom3bcfg in the search path, but it no longer adds that.

How would one add another directory that contains base in the command line or settings file? I would have assumed /usr/share/doom3bfg should have been added by default?

naggie commented 1 month ago

renderprogs2

I don't have this folder in my directory obtained from steam. Is it present in GoG?

How would one add another directory that contains base in the command line or settings file? I would have assumed /usr/share/doom3bfg should have been added by default?

I think it uses the current working directory in addition to the exe location, so you could with a wrapper script.

Zaechus commented 1 month ago

The renderprogs2 folder and other files don't come with the GOG or Steam versions. RBDOOM-3-BFG has a more involved installation than other source ports in that its releases provide additional files that need to be extracted over your Doom 3: BFG Edition installation from GOG or Steam. This looks roughly like:

  1. Download the two files for the GOG offline installer.
  2. Extract the game files either by running the exe with wine or innoextract -gm.
  3. Create a new folder for Doom at one of its default search paths: ~/.local/share/rbdoom3bfg.
  4. Move the base directory from the extracted GOG directory into the rbdoom3bfg directory from the last step.
  5. Now, download the 7z archive from the latest release of RBDOOM-3-BFG and move the 7z file into the rbdoom3bfg directory. Your ~/.local/share/rbdoom3bfg directory should contain something like:
    base
    RBDOOM-3-BFG-1.5.1.2-lite-win64-20230523-git-39ae120.7z
  6. Extract the 7z archive while in the rbdoom3bfg directory using 7z x. This will add the missing renderprogs2 folder into base.
  7. Now you can run RBDoom3BFG from anywhere.

Additionally, there is a ~6 GB package you can get from ModDB, but it's not required to launch Doom.

You can find this information on the RBDOOM-3-BFG releases page.

naggie commented 1 month ago

Thanks @Zaechus -- much appreciated. I had completely missed the fact that I needed additional assets aside from the EXE and GoG base directory.

I guess the extra 6GB file is needed for ~the enhanced graphics.~ Just pre-calculated assets that can be derived?

It would be nice to get the nix package to download the 7z lite archive from github, but I guess we have a chicken + egg situation as we can't include the GoG release in the package derivation, which is required in order to apply the 7z patch

naggie commented 1 month ago

Here's what I came up with, in case anyone else finds it useful. I still have to add a few things like a desktop icon,

https://gist.github.com/naggie/ce79a4f52a1179fbe712e0c042a8ed92