Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dethrace won't start on my VMWare/Fedora 38 #315

Closed
LowLevelMahn opened this issue May 1, 2023 · 13 comments · Fixed by #322
Closed

Dethrace won't start on my VMWare/Fedora 38 #315

LowLevelMahn opened this issue May 1, 2023 · 13 comments · Fixed by #322

Comments

@LowLevelMahn
Copy link

LowLevelMahn commented May 1, 2023

its inside a VMWare vm - so no native opengl drivers available (i think)

build with Fedora 38/gcc 13.1.1 without any warning

just gives me that output

[linux@fedora __build]$ DETHRACE_ROOT_DIR=../Carma/ ./dethrace 
Dethrace version: v0.6.0-21-g34a22f2
Data directory: ../Carma/
Game mode: Carmageddon
warning: queue 0x22bac10 destroyed while proxies still attached:
  wl_display@1 still attached
[INFO] GLRenderer_Init OpenGL vendor string: Mesa
[INFO] GLRenderer_Init OpenGL renderer string: llvmpipe (LLVM 16.0.1, 256 bits)
[INFO] GLRenderer_Init OpenGL version string: 4.5 (Core Profile) Mesa 23.0.3
[INFO] GLRenderer_Init OpenGL shading language version string: 4.50
warning: queue 0x237a820 destroyed while proxies still attached:
  wl_callback@40 still attached
  wl_surface@38 still attached
warning: queue 0x22ba910 destroyed while proxies still attached:
  wl_display@1 still attached
[linux@fedora __build]$ 

SUSE/Tumbleweed

linux@localhost:~/tests/dethreace_dev/__build> DETHRACE_ROOT_DIR=../Carma/ ./dethrace 
Dethrace version: v0.6.0-21-g34a22f2
Data directory: ../Carma/
Game mode: Carmageddon
[INFO] GLRenderer_Init OpenGL vendor string: VMware, Inc.
[INFO] GLRenderer_Init OpenGL renderer string: SVGA3D; build: RELEASE;  LLVM;
[INFO] GLRenderer_Init OpenGL version string: 4.3 (Compatibility Profile) Mesa 23.0.2
[INFO] GLRenderer_Init OpenGL shading language version string: 4.30
linux@localhost:~/tests/dethreace_dev/__build> 
@madebr
Copy link
Collaborator

madebr commented May 1, 2023

What does it do when you copy the dethrace executable to the game data folder, and execute from there?

It must be placed in the same folder as where the original .exe's can be found.
Also, the executable is sensitive to the working directory, so cd to this folder before execution.
You don't need to set the DETHRACE_ROOT_DIR env variable anymore in this case.

I want to exclude our currently broken error reporting (#312).

@LowLevelMahn
Copy link
Author

What does it do when you copy the dethrace executable to the game data folder, and execute from there?

it happens the same - copied the executable into the folder were the CARMA.EXE was and in the DATA folder for testing

@LowLevelMahn
Copy link
Author

LowLevelMahn commented May 1, 2023

same happens with a VS2022/SDL2-2.26.5 build under Win 10 (exe in CARMA.EXE directory or in DATA directory and with changed working-dir)

D:\temp\dethreace_dev\Carma>Dethrace version: v0.6.0-21-g34a22f2
[INFO] Harness_Init DETHRACE_ROOT_DIR is not set, assuming '.'
Game mode: Carmageddon
[INFO] GLRenderer_Init OpenGL vendor string: NVIDIA Corporation
[INFO] GLRenderer_Init OpenGL renderer string: NVIDIA GeForce GT 1030/PCIe/SSE2
[INFO] GLRenderer_Init OpenGL version string: 3.1.0 NVIDIA 522.25
[INFO] GLRenderer_Init OpenGL shading language version string: 1.40 NVIDIA via Cg compiler
D:\temp\dethreace_dev\Carma>

@LowLevelMahn
Copy link
Author

i've added a

int checked_access(const char* filename, int mode) {
    int res = access(filename, mode);
    printf("checked_access(\"%s\", %i) = %i\n", filename, mode, res);
    return res;
}

and replaced all the access(...) calls with checked_access(...) in Harness_DetectGameMode()

this is the output

Dethrace version: v0.6.0-21-g34a22f2
[INFO] Harness_Init DETHRACE_ROOT_DIR is not set, assuming '.'
checked_access("DATA/RACES/CASTLE.TXT", 0) = -1
checked_access("DATA/RACES/CITYB3.TXT", 0) = 0
checked_access("DATA/RACES/CITYA1.TXT", 0) = 0
checked_access("DATA/CUTSCENE/Mix_intr.smk", 0) = 0
Game mode: Carmageddon
checked_access("DATA/TRNSLATE.TXT", 0) = -1
[INFO] GLRenderer_Init OpenGL vendor string: NVIDIA Corporation
[INFO] GLRenderer_Init OpenGL renderer string: NVIDIA GeForce GT 1030/PCIe/SSE2
[INFO] GLRenderer_Init OpenGL version string: 3.1.0 NVIDIA 522.25
[INFO] GLRenderer_Init OpenGL shading language version string: 1.40 NVIDIA via Cg compiler

@LowLevelMahn
Copy link
Author

LowLevelMahn commented May 1, 2023

also extenden PDFatalError(...) with a printf

void PDFatalError(char* pThe_str) {
    printf("PDFatalError: %s\n", pThe_str);
    LOG_TRACE("(\"%s\")", pThe_str);

    dr_dprintf("FATAL ERROR: %s", pThe_str);
    Win32FatalError(pThe_str, NULL);
}

now the startup shows

Dethrace version: v0.6.0-21-g34a22f2
[INFO] Harness_Init DETHRACE_ROOT_DIR is not set, assuming '.'
checked_access("DATA/RACES/CASTLE.TXT", 0) = -1
checked_access("DATA/RACES/CITYB3.TXT", 0) = 0
checked_access("DATA/RACES/CITYA1.TXT", 0) = 0
checked_access("DATA/CUTSCENE/Mix_intr.smk", 0) = 0
Game mode: Carmageddon
checked_access("DATA/TRNSLATE.TXT", 0) = -1
[INFO] GLRenderer_Init OpenGL vendor string: NVIDIA Corporation
[INFO] GLRenderer_Init OpenGL renderer string: NVIDIA GeForce GT 1030/PCIe/SSE2
[INFO] GLRenderer_Init OpenGL version string: 3.1.0 NVIDIA 522.25
[INFO] GLRenderer_Init OpenGL shading language version string: 1.40 NVIDIA via Cg compiler
PDFatalError: This .exe must have KEYBOARD.COK in the DATA folder.

so it seems my game version is not the correct one

the only problem seems to be the hidden logging that already explains exactly what the problem is

@LowLevelMahn
Copy link
Author

Works with different game version

Dethrace version: v0.6.0-21-g34a22f2
[INFO] Harness_Init DETHRACE_ROOT_DIR is not set, assuming '.'
checked_access("DATA/RACES/CASTLE.TXT", 0) = -1
checked_access("DATA/RACES/CITYB3.TXT", 0) = 0
checked_access("DATA/RACES/CITYA1.TXT", 0) = 0
checked_access("DATA/CUTSCENE/Mix_intr.smk", 0) = -1
Game mode: Carmageddon
checked_access("DATA/TRNSLATE.TXT", 0) = -1
[INFO] GLRenderer_Init OpenGL vendor string: NVIDIA Corporation
[INFO] GLRenderer_Init OpenGL renderer string: NVIDIA GeForce GT 1030/PCIe/SSE2
[INFO] GLRenderer_Init OpenGL version string: 3.1.0 NVIDIA 522.25
[INFO] GLRenderer_Init OpenGL shading language version string: 1.40 NVIDIA via Cg compiler
[WARN] BrSystemConfigBegin stubbed
[WARN] HostImageLoad stubbed
[WARN] NetService stubbed
[WARN] DefaultNetSettings stubbed
[WARN] BrTokenValueSetMany stubbed
[WARN] BrTokenValueSetMany stubbed
[WARN] BrTokenValueSetMany stubbed
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/PALETTES/."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/PALETTES/.."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/SHADETAB/."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/SHADETAB/.."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/PIXELMAP/."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/PIXELMAP/.."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/MATERIAL/."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/MATERIAL/.."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/MODELS/."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/MODELS/.."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/LIGHTS/."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/REG/LIGHTS/.."
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/32X20X8/PIXELMAP/Evalu01.PIX"
[WARN] S3StopMIDIOutlets stubbed
[WARN] S3StopCDAOutlets stubbed
[WARN] AllocateStandardLamp stubbed
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/32X20X8/PIXELMAP/OIL.PIX"
[WARN] BrTokenValueSetMany stubbed
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/32X20X8/PIXELMAP/HANDX.PIX"
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/32X20X8/PIXELMAP/HANDPX.PIX"
Failed to open "D:\temp\dethreace_dev\Carmageddon_Max_Pack_1998\Carmaged\CARMA/DATA/32X20X8/PIXELMAP/CURSGIBX.PIX"

added missing newline to a error output function

FILE* OS_fopen(const char* pathname, const char* mode) {
    FILE* f;
    errno_t err;

    f = NULL;
    err = fopen_s(&f, pathname, mode);
    if (err != 0) {
        fprintf(stderr, "Failed to open \"%s\"\n", pathname); // <--- added missing \n here to get better log output
    }

    return f;
}

@dethrace-labs
Copy link
Owner

so it seems my game version is not the correct one

What version of the game were you using?

@dethrace-labs
Copy link
Owner

FYI the missing error messages introduced in a recent refactor are now fixed in #316

@LowLevelMahn
Copy link
Author

LowLevelMahn commented May 2, 2023

so it seems my game version is not the correct one

What version of the game were you using?

https://gamesnostalgia.com/game/carmageddon
Download for PC: DOS version 1.1 - Language: English - Size: 28.28 Mb

seemed to be a stripped down version

this version works: https://archive.org/download/msdos_Carmageddon_Max_Pack_1998
Carmageddon_Max_Pack_1998.zip (View Contents) 08-Oct-2019 15:14 1.2G

@LowLevelMahn
Copy link
Author

LowLevelMahn commented May 2, 2023

FYI the missing error messages introduced in a recent refactor are now fixed in #316

works on Windows and Linux

still missing \n in OS_fopen(...) fprintf - which only trashes the log output under Windows

image

to fix log output

image

@madebr
Copy link
Collaborator

madebr commented May 2, 2023

The STYLE.EXE binary, available in the archives in this link embeds the ascii table.
This table is the same as KEYBOARD.COK, provided by other Carmageddon releases.

So I think we should embed this table too.
Let's make failure to find KEYBOARD.COK not a fatal anymore.
And use KEYBOARD.COK when it's available.

@dethrace-labs
Copy link
Owner

Yeah, I took a look at STYLE too :)

Its weird that the embedded gASCII_table is different between the different demo versions.

Its also really weird that some versions look for keyboard.cokand some don't. The CARMA.EXE from the GOG release does look for it, but its Date Modified is in 2012, so I can't compare it to the 15/06/1997 date from the gamesnostalgia package to see if it was originally older or newer.

@madebr
Copy link
Collaborator

madebr commented May 3, 2023

I just extracted the ascii tables from my original 90ies cd (I think it's this one), and it has yet another ascii table.
(They are initialized in KeyBegin at 0x0048f8b0):

gASCII_table = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 0, 45, 61, 127, 13, 13, 9, 0, 0, 0, 0, 46, 44, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32]
gASCII_shift_table = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70, 71, 72, 73, 106, 75, 76, 77, 78, 79, 112, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 0, 45, 61, 127, 13, 13, 9, 0, 0, 0, 0, 46, 44, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32]

Remarkable about this one is that it contains lower case ascii codes in the non-uppercase array.

I think we should interpret the ascii tables as a mapping from scancode to keycode (≈ascii),
and thus should expect variation due to localization.

Can we generate the table dynamically by going the "reverse" way?
Carmageddon keycode -> DirectInput code -> SDL codes -> ...

Speaking about localization. We're currently using SDL_Keycode. Shouldn't we use SDL_Scancode instead?
SDL_Keycode is already mapped to the current to the current keyboard layout.,
SDL_Scancode isn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants