TheAssemblyArmada / Vanilla-Conquer

Vanilla Conquer provides clean, cross-platform builds of the C&C Remastered Collection and the standalone legacy games.
Other
351 stars 53 forks source link

[macOS] Data files not found in sub-folders #795

Closed MLipfert1 closed 2 years ago

MLipfert1 commented 2 years ago

I installed all required data files for RA and TD as explained in the corresponding Wiki articles. The source were the retail discs for the main games and the extensions.

When I start VanillaRA, the main menu appears and I am able to select one of the campaigns. However, after choosing the difficulty level, the game exits to the desktop. VanillaTD shows a similar behavior: It does not exit, but it shows a message box, saying the data files are not available.

I figured out, that the games are not able to load the mix files from sub-folders inside the data folders. When I move the main.mix file from the RA allies-CD beside the redalert.mix, then I am able to load the allies campaign without issues. All sub-folders are named exactly as specified in the Wiki.

I reproduced this issue on two ARM-based Macs with macOS 12.4 by using the development snapshot builds (Intel-only, running with Rosetta 2) and by using universal binaries, which I compiled myself.

OmniBlade commented 2 years ago

The game will choose between 3 possible locations when looking for the data, where did you place the data files? Unfortunately none of the main devs have a system running macOS to debug this, most of the macOS specific code was written blind so we are currently relying on people such as yourself to help us debug it. Can you try and run the game from the command line interface and capture some debug logging from a debug build?

MLipfert1 commented 2 years ago

The data files are places inside /Users/mlipfert/Library/Application Support/Vanilla-Conquer/vanillara:

image

The main.mix files in the respective sub-folders.

Running VanillaRA (release build) from the command line and running into the crash results only in "zsh: trace trap /Applications/VanillaRA.app/Contents/MacOS/vanillara". But I have attached a crash report that appeared also. I hope this helps.

Maybe I can also find some time to debug it myself in the next days. Would be really nice to have fully working RA and TD builds for macOS. ;-)

Debug log: debugInfo.txt

MLipfert1 commented 2 years ago

I was able to create a Xcode project via cmake and I immediately started a short debug session. The problem seems to be the "vol.Is_Directory()" call in redalert/conquer.cpp, line 3885. It always returns false. When I find some time, I will dive deeper into it and try to fix it (without breaking the directory detection for other operation systems I hope :-) ).

MLipfert1 commented 2 years ago

After one hour of debugging with Xcode, I was able to find the culprit. Now I will prepare a bug fix and create a pull request very soon.

OmniBlade commented 2 years ago

There is a bug in CDFileClass that means a lot of the complication you added shouldn't be neccessary, the idea is that you shouldn't need a specifc path for the save games though, it should always be whatever got set to the UserData folder. See https://github.com/TheAssemblyArmada/Vanilla-Conquer/pull/715 for some of the changes which might fix your save issues with less code changes.

OmniBlade commented 2 years ago

https://github.com/TheAssemblyArmada/Vanilla-Conquer/pull/715/commits/7313be758ce97de4b78e00db27d2becc53c78c3c is the commit that fixes the bug.

MLipfert1 commented 2 years ago

I will try your changes. If they may improve my code, should I take your commits to my branch that is connected to my pull request or do you want to approve your own pull request before?

OmniBlade commented 2 years ago

Cherry pick the commits into your branch if you wish, the pipe/straw stuff still needs reviewing by someone else but I don't think the save/load dialog changes or the CDFileClass fix are that controversial.

MLipfert1 commented 2 years ago

I have updated my branch and the PR #801. The two uncritical commits from you are part of it and I removed my savegame related commit as it is absolutely not necessary for RA anymore. Saving and loading works like a charm and even bug #819 is fixed with that. However the savegame system of TD is not working as expected, as it requires also your third commit.

In my opinion, we should go for my updated branch and bring it to the main branch. Then we should test your third commit thoroughly and pull that at a later stage also to the main branch, in order to have a fully working save / load system and also a working macOS version on the main branch. :-)

MLipfert1 commented 2 years ago

This issue is finally solved by the latest commits on the main branch.