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

Dispose track after race + get german localization running #107

Merged
merged 6 commits into from
Mar 27, 2022

Conversation

madebr
Copy link
Collaborator

@madebr madebr commented Mar 20, 2022

This pr:

  • implements DisposeTrack (+depending functions). It is now possible to start a 2nd race in the same DethRace execution
  • implement functions to support localized carmageddon releases: tested with a German localization
  • fixes demo + text input for demo's

@laenion Can you test this?
The german version has the following issues:

  • In all races, the HUD is hidden behind terrain (uk version also has this problem in e.g. fridge racer)
  • in maim street, the front culling is too aggressive (the terrain is shown too late)

There is also a visual glitch with the umlaut on "neues spiel über netzwerk".
Comparing the data structures sizing the interface, there appears to be no difference between the uk and german release.
Is this also present when running the windows/dos version?
(the umlaut remains visible when changing the active menu item)

The splatpack + xmas demo version stil do not work.

Screenshot from 2022-03-20 19-03-59

Closes #99
Closes #110

@laenion
Copy link

laenion commented Mar 21, 2022

Your branch is crashing with a segmentation fault for me; I'll have a more detailed look at it in the evening. Just in case you see something immediately:

DETHRACE_ROOT_DIR: /home/gamer/CARMA/
[INFO] Harness_DetectGameMode "Carmageddon"
[WARN] BrSystemConfigBegin stubbed
[WARN] HostImageLoad stubbed
[WARN] SoundService stubbed
[WARN] NetService stubbed

******************
Caught SIGSEGV
******************

Stack trace:
0: ?? ??:0
1: ?? ??:0
2: ?? ??:0
3: GetThreeInts at /home/gamer/dethrace/src/DETHRACE/common/loading.c:2835
4: LoadGeneralParameters at /home/gamer/dethrace/src/DETHRACE/common/loading.c:346
5: InitialiseApplication at /home/gamer/dethrace/src/DETHRACE/common/init.c:345
6: InitialiseDeathRace at /home/gamer/dethrace/src/DETHRACE/common/init.c:407
7: GameMain at /home/gamer/dethrace/src/DETHRACE/common/main.c:98
8: original_main at /home/gamer/dethrace/src/DETHRACE/pc-dos/dossys.c:667
9: main at /home/gamer/dethrace/src/DETHRACE/main.c:29
10: ?? ??:0
11: ?? ??:0

It didn't want to accept the disc contents directly due to missing write permissions, so DETHRACE_ROOT_DIR is directing to a full installation of the game now.

@madebr
Copy link
Collaborator Author

madebr commented Mar 21, 2022

While trying to get the demo's running again, looks like I broke OG Carmageddon.

didn't want to accept the disc contents directly due to missing write permissions, so DETHRACE_ROOT_DIR is directing to a full installation of the game now.

Carmageddon writes to the data folder, so it does not support read-only data directories.
That's something we will probably need to address once we have the complete game figured out.

@laenion
Copy link

laenion commented Mar 21, 2022

Hmmm... Now it complains about

[INFO] Harness_DetectGameMode "Carmageddon"
[INFO] Harness_DetectGameMode Language: "German"
[WARN] BrSystemConfigBegin stubbed
[WARN] HostImageLoad stubbed
[WARN] SoundService stubbed
[WARN] NetService stubbed
[WARN] DefaultNetSettings stubbed
[WARN] BrTokenValueSetMany stubbed
[WARN] BrTokenValueSetMany stubbed
[WARN] BrTokenValueSetMany stubbed
[WARN] BrDevLastBeginQuery stubbed
FATAL ERROR: Unable to find required palette

@madebr
Copy link
Collaborator Author

madebr commented Mar 21, 2022

Strange, my german carmageddon data directory should not be different from yours.
I simply copied the complete CD to hd, not using an installed folder.
Are you perhaps running dethrace in an installed carmageddon folder?
Also, what system are you using?

The error is emitted in the InitializePalettes function.
The actual loading of the palette happens in LoadInRegisteeDir.
If you add a debug breakpoint here, it should encounter DRRENDER.PAL and DRACEFLC.PAL.

@laenion
Copy link

laenion commented Mar 23, 2022

Yes, for the previous test I was using an installed version of Carmageddon (I thought that was necessary), but now I also just copied the contents from disc.

The result is still the same though (plus two warnings about PATHS.TXT and OPTIONS.TXT not being found). The interesting thing is that DRLoadPalette (at least that's where I thing you wanted to link to) never seems to be reached. It aborts in https://github.com/madebr/dethrace/blob/dispose-track/src/DETHRACE/common/graphics.c#L617 instead.

I'm using the madebr/dispose-track branch - I assume that is the branch you are also testing with?

@madebr
Copy link
Collaborator Author

madebr commented Mar 23, 2022

The warnings about PATHS.TXT OPTIONS.TXT are expected. I have them too and the game loads fine.
DethRace expects the OPTIONS.TXT file to be encoded, which it isn't. It falls back to default options.
The PATHS.TXT warning is a consequence of OPTIONS.TXT not being found.

The breakpoint is not hit because it can't find those palette files.
To be clear, you need to set the DETHRACE_ROOT_DIR to the directory containing the carmageddon exe's, not the DATA directory.

export DETHRACE_ROOT_DIR=/directory/to/german/carmageddon

The output of the following command must contain DRRENDER.PAL and DRACEFLC.PAL.
If not, you need to do 2 things: 1. check whether the copy was complete and 2. check the DETHRACE_ROOT_DIR environment variable.

ls $DETHRACE_ROOT_DIR/DATA/REG/PALETTES

You can simply run dethrace by executing:

/path/to/dethrace

If it is still failing, can you tell a bit more about your system? OS? Filesystem? Is it case sensitive?

if (AllocationErrorsAreFatal()) {
FatalError(14, gMain_flic_list[pIndex].file_name);
}
#ifdef DETHRACE_FIX_BUGS
fclose(f);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this to make the compiler happy?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really.
If allocation errors are not fatal, this code path can leak.
Very unlikely, I know.

} else {
harness_game_info.defines.INTRO_SMK_FILE = "MIX_INTR.SMK";
carmageddon:
if (access("DATA/CURSCENE/Mix_intr.smk", F_OK) == -1) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CURSCENE should be CUTSCENE?

Also, do we need this now we've fixed the case sensitive file access?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, can be collapsed into one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the INTO_SMK_FILE variable can be set unconditionally

Copy link
Collaborator Author

@madebr madebr Mar 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the INTO_SMK_FILE variable can be set unconditionally.
I'm not so sure, because this is used by libsmacker, not by DRfopen.

Copy link
Collaborator Author

@madebr madebr Mar 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to patch smk_open_file for that.
It looks like that function has already been customized.

src/harness/harness.c Outdated Show resolved Hide resolved
@dethrace-labs dethrace-labs merged commit 8cf723c into dethrace-labs:main Mar 27, 2022
@madebr madebr deleted the dispose-track branch March 27, 2022 21:55
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 this pull request may close these issues.

Latest commit crashes build on Manjaro German and demo version support broken?
3 participants