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

Fix broken game load/save on Linux due to case sensitive opendir() #119

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bit-hack
Copy link

@bit-hack bit-hack commented Nov 18, 2023

I compiled fallout-ce on my RaspberryPi-400 and uConsole (a similar device). Everything seems to be working fine except game saving and loading were not working, and would pop up a dialog saying saving/loading failed.

I traced this back to a failure of the opendir() call in src/plib/db/db.cc. Part of the path it is trying to open is formed from the so-called patches_path.

This seems to come from the critter_patches=data and master_patches=data entries in the fallout.cfg config.
If there is no fallout.cfg file then the defaults used by fallout can be found at src/game/gconfig.cc:59:

    // Initialize defaults.
   . ..
    config_set_string(&game_config, GAME_CONFIG_SYSTEM_KEY, GAME_CONFIG_MASTER_PATCHES_KEY, "data");
    ...
    config_set_string(&game_config, GAME_CONFIG_SYSTEM_KEY, GAME_CONFIG_CRITTER_PATCHES_KEY, "data");

The game files that I have from Steam however use an upper case naming scheme for the DATA folder.
The opendir call was then failing because using lower case data in the path would not match the upper case DATA of my files.

I found the compat_resolve_path function, which looks like it accounts for this and will adjust a path to match the case used by the file system. Using this function before opendir() resolved the problem for me and I can now load and save the game correctly on my RaspberryPi running Linux using the Steam data files.

Is an upper case DATA folder conventional on all distributions of fallout?
I wonder if we should adjust the default values to be upper case to be a little more correct if that is true?

If someone suggests a more appropriate place to do the path conversion, I'd be happy to revise this patch.

Also this may relate to #102

@spiman
Copy link

spiman commented Dec 9, 2023

Can confirm it relates to #102 , had the same issue on Pop!OS 22.04 with the GOG version of the game, compiling with your fork resolves the issue.

@ScissorShiv
Copy link

I am also having the same issue described here. I've successfully installed both Fallout-CE for Fallout 1 and 2 on my Raspberry Pi 4 through Retropie utilizing the script module located here:

https://github.com/Exarkuniv/RetroPie-Extra/tree/master/scriptmodules/ports

After transferring the required files from my GOG installation of both games, they both appear to be working fine with the exception of being able to save and load. I've read through the comments posted here as well as the others discussing the issue at hand and unfortunately I am a bit lost as to how to remedy the problem with the info available. My abilities concerning compiling and writing scripts are practically zero. Any assistance in how to fix the issue would be greatly appreciated. Cheers

@camilocodes
Copy link

camilocodes commented Apr 15, 2024

I am also having the same issue described here. I've successfully installed both Fallout-CE for Fallout 1 and 2 on my Raspberry Pi 4 through Retropie utilizing the script module located here:

https://github.com/Exarkuniv/RetroPie-Extra/tree/master/scriptmodules/ports

After transferring the required files from my GOG installation of both games, they both appear to be working fine with the exception of being able to save and load. I've read through the comments posted here as well as the others discussing the issue at hand and unfortunately I am a bit lost as to how to remedy the problem with the info available. My abilities concerning compiling and writing scripts are practically zero. Any assistance in how to fix the issue would be greatly appreciated. Cheers

Hi. I have been hitting a wall for a few hours trying to solve this, then I carefully read through the text above and it seemed to me like (outside of recompiling) this could be fixed by renaming my DATA folder to data (lowercase). It was my last ditch attempt.

And it worked! Try it out! Hope it works for you too. I'm using the latest release of fallout-ce, and the GOG Fallout 1 extracted with the latest version of innoextract. On Ubuntu 22.04.4 LTS.

@niltooth
Copy link

niltooth commented May 3, 2024

i'm also having the same issue. i put in sym links to temporarily resolve

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.

None yet

5 participants