ValveSoftware / Proton

Compatibility tool for Steam Play based on Wine and additional components
Other
23.48k stars 1.03k forks source link

Atelier Lydie & Suelle ~The Alchemists and the Mysterious Paintings~ (756590) #2452

Open BillFleming opened 5 years ago

BillFleming commented 5 years ago

Compatibility Report

System Information

I confirm:

Symptoms

The game's launcher shows up, but crashes when opening the settings menu. When loading the game it crashes after the GUST logo. Appears to show a loading icon right before crash. Attached log of opening launcher then closing (no crash), log of opening settings from launcher (separate exe), and log of trying to run the game. As was mentioned in the report for 527290 the crashes appear to be the same as in Atelier Firis. Same behavior on another machine with RX480.

Reproduction

  1. Install the game.
  2. Try to launch it.

ExitLauncherNoCrash_steam-756590.log GameCrash_steam-756590.log SettingsCrash_steam-756590.log

BillFleming commented 5 years ago

AtelierLydieSuelle For completeness here is a picture of the settings screen crash error message about DirectX.

ghost commented 5 years ago
21353.361:002b:003e:fixme:quartz:Parser_QueryInterface No interface for {37d84f60-42cb-11ce-8135-00aa004bb851}!
21353.361:002b:003e:fixme:quartz:MPEGSplitter_QueryInterface No interface for {37d84f60-42cb-11ce-8135-00aa004bb851}!
21353.361:002b:003e:fixme:quartz:MPEGSplitter_query_accept {00000000-0000-0000-0000-000000000000}
21353.361:002b:003e:fixme:quartz:Parser_QueryInterface No interface for {37d84f60-42cb-11ce-8135-00aa004bb851}!

Looks like it's trying to play some media file. This probably won't work but can you install quartz in the prefix and see what happens? Something like this.

WINEPREFIX="/home/user/steam_library/steamapps/compatdata/756590/pfx" winetricks quartz

https://github.com/ValveSoftware/Proton/issues/1464

BillFleming commented 5 years ago

Following exolyte's Firis advice here with Proton 4.2 I can now go in game, but it cannot save. https://github.com/ValveSoftware/Proton/issues/1486#issuecomment-451980052

3832.040:002e:0041:fixme:shell:SHCreateDirectoryExW Show system error message, creating path L"C:\\users\\steamuser\\My Documents\\KoeiTecmo\\Atelier Lydie and Suelle\\SAVEDATA\\", failed with error 183 I suspected that maybe the path was too long (other Atelier games save in folder A17, A18, etc) and remounted my RAID with shorter path but it still happens. Went from /mnt/RAID0_1_4TB/Steam/steamapps/compatdata/756590/pfx/drive_c/users/steamuser/My Documents/KoeiTecmo/Atelier Lydie and Suelle/SAVEDATA to /mnt/R0/Steam/steamapps/compatdata/756590/pfx/drive_c/users/steamuser/My Documents/KoeiTecmo/Atelier Lydie and Suelle/SAVEDATA

SaveIIssuesteam-756590.log

Saving in Firis works fine.

ubuntor commented 5 years ago

Hm, that error is ERROR_ALREADY_EXISTS.

BillFleming commented 5 years ago

Now that I finally have time to look into this more my suspicions were correct. If I delete/rename the SAVEDATA folder the game will save, but only ONCE. Then I have to rename the folder again to make a new save. I also tried the game in the default install path on my system (below) but it also didn't seem to make any difference. (so the period in the path doesn't seem to cause issues)

/home/bill/.local/share/Steam/steamapps/compatdata/756590/pfx/drive_c/users/steamuser/My Documents/KoeiTecmo/Atelier Lydie and Suelle/SAVEDATA

The game has a sorta lengthy intro sequence before you can get to the part where you can save. So I have attached a save at the very beginning of the game. Just extract the .pcsave file into the SAVEDATA folder. Then after loading the game walk to the desk to try saving. SAVE DATA00.pcsave.tar.gz

Also I have confirmed that this game does need the dll workaround and it will not launch properly without it.

Any tips on getting more wine debug output specifically for the save issue? After some searching around there should be a launcher script called proton_winedbg_run but I don't have it on my machine. When I load the local "Wine-dbg>info process" per the wine FAQ to try hot attach I don't see any of the proton processes listed.

BillFleming commented 5 years ago

So recently I had worked on a project that actually used winAPI code for file saving and it was different than on all other platforms I have worked on (embedded, using standard c/c++ file API, QT's file api, etc)

You have to be very particular when trying to open a file to use the correct flags or it will return an invalid file handle. So for example on a typical platform if you want to append to a file, you just call the open function with read/write flags then afterwards you could move to the end or what not. If the file does not exists on most platforms it will auto create the file in the same open function call. (no extra open calls needed) But in Windows using the API it is trickier. You can't just use just one function call. (at least that know from limited experience)

// example of what is required to open file for append, or create new file if not existing using winAPI (In this example the SYS_FILE_FLAG is defined to the windows API defines whatever they are.)
char  acFileName[SYS_MAX_PATH];
SYS_FILE_HANDLE G_logFile;
snprintf(acFileName, UTIL_SIZEOF(acFileName), "../Log/ProgramLog.csv"); // set a file name first

// try opening file for append first
G_logFile = SYS_FILE_Open(acFileName, SYS_FILE_FLAG_WRITE | SYS_FILE_FLAG_SHARE_READ |
        SYS_FILE_FLAG_APPEND // sets pointer to end
);

if (G_logFile == SYS_INVALID_HANDLE) { // if no existing file try creating new one
    G_logFile = SYS_FILE_Open(acFileName, SYS_FILE_FLAG_WRITE | SYS_FILE_FLAG_SHARE_READ | 
        SYS_FILE_FLAG_CREATE | SYS_FILE_FLAG_TRUNC //always create new file
    );
}
if (G_logFile == SYS_INVALID_HANDLE) {
      // couldn't open or create new file, either some path issue or permission issue, etc.
}

My point on all of this is that the game probable does something similar to check that the folder is present when trying to save, in case the folder doesn't exist. So there is probably some winAPI file flag that isn't being handled correctly related to the folder creation/open.

Also I am seeing this same issue in another Koei Tecmo game (will file bug report later) and I suspect that there are other games/programs out there that might suffer from this same issue.

ubuntor commented 5 years ago

Here are the relevant snippets of WINEDEBUG=+file logs. (Tried +relay but there's too much to go through and RelayExclude/RelayInclude stuff doesn't seem to work well...)

Save failure (when SAVEDATA directory exists):

0037:trace:file:CreateDirectoryW L"C:\\users\\steamuser\\My Documents\\KoeiTecmo\\Atelier Lydie and Suelle\\SAVEDATA\\"
0037:trace:file:RtlDosPathNameToNtPathName_U_WithStatus (L"C:\\users\\steamuser\\My Documents\\KoeiTecmo\\Atelier Lydie and Suelle\\SAVEDATA\\",0x316af400,(nil),(nil))
0037:trace:file:RtlGetFullPathName_U (L"C:\\users\\steamuser\\My Documents\\KoeiTecmo\\Atelier Lydie and Suelle\\SAVEDATA\\" 520 0x316af060 (nil))
0037:trace:file:wine_nt_to_unix_file_name L"\\users\\steamuser\\My Documents\\KoeiTecmo\\Atelier Lydie and Suelle\\SAVEDATA\\" not found in /home/samuel/.local/share/Steam/steamapps/compatdata/756590/pfx/dosdevices/c:/users/steamuser/My Documents/KoeiTecmo/Atelier Lydie and Suelle/SAVEDATA/
0037:fixme:shell:SHCreateDirectoryExW Show system error message, creating path L"C:\\users\\steamuser\\My Documents\\KoeiTecmo\\Atelier Lydie and Suelle\\SAVEDATA\\", failed with error 183

Save success (when SAVEDATA directory doesn't exist):

0037:trace:file:CreateDirectoryW L"C:\\users\\steamuser\\My Documents\\KoeiTecmo\\Atelier Lydie and Suelle\\SAVEDATA\\"
0037:trace:file:RtlDosPathNameToNtPathName_U_WithStatus (L"C:\\users\\steamuser\\My Documents\\KoeiTecmo\\Atelier Lydie and Suelle\\SAVEDATA\\",0x316af400,(nil),(nil))
0037:trace:file:RtlGetFullPathName_U (L"C:\\users\\steamuser\\My Documents\\KoeiTecmo\\Atelier Lydie and Suelle\\SAVEDATA\\" 520 0x316af060 (nil))
0037:trace:file:wine_nt_to_unix_file_name L"\\??\\C:\\users\\steamuser\\My Documents\\KoeiTecmo\\Atelier Lydie and Suelle\\SAVEDATA\\" -> "/home/samuel/.local/share/Steam/steamapps/compatdata/756590/pfx/dosdevices/c:/users/steamuser/My Documents/KoeiTecmo/Atelier Lydie and Suelle/SAVEDATA"
0037:trace:file:GetFileAttributesW L"C:\\users\\steamuser\\Desktop"
0037:trace:file:RtlDosPathNameToNtPathName_U_WithStatus (L"C:\\users\\steamuser\\Desktop",0x316ae630,(nil),(nil))
0037:trace:file:RtlGetFullPathName_U (L"C:\\users\\steamuser\\Desktop" 520 0x316ae2e0 (nil))
0037:trace:file:wine_nt_to_unix_file_name L"\\??\\C:\\users\\steamuser\\Desktop" -> "/home/samuel/.local/share/Steam/steamapps/compatdata/756590/pfx/dosdevices/c:/users/steamuser/Desktop"
0037:trace:file:find_drive_rootA "/" -> drive Z:, root="/", name="/"
0037:trace:file:RtlDosPathNameToNtPathName_U_WithStatus (L"C:\\",0x316ab690,(nil),(nil))
0037:trace:file:RtlGetFullPathName_U (L"C:\\" 520 0x316ab340 (nil))
0037:trace:file:wine_nt_to_unix_file_name L"\\??\\C:\\" -> "/home/samuel/.local/share/Steam/steamapps/compatdata/756590/pfx/dosdevices/c:/"
0037:trace:file:RtlDosPathNameToNtPathName_U_WithStatus (L"C:\\users\\steamuser\\My Documents\\KoeiTecmo\\Atelier Lydie and Suelle\\SAVEDATA\\",0x316ab690,(nil),(nil))
0037:trace:file:RtlGetFullPathName_U (L"C:\\users\\steamuser\\My Documents\\KoeiTecmo\\Atelier Lydie and Suelle\\SAVEDATA\\" 520 0x316ab340 (nil))
0037:trace:file:wine_nt_to_unix_file_name L"\\??\\C:\\users\\steamuser\\My Documents\\KoeiTecmo\\Atelier Lydie and Suelle\\SAVEDATA\\" -> "/home/samuel/.local/share/Steam/steamapps/compatdata/756590/pfx/dosdevices/c:/users/steamuser/My Documents/KoeiTecmo/Atelier Lydie and Suelle/SAVEDATA/"
0037:trace:file:CreateFileW L"C:\\users\\steamuser\\My Documents\\KoeiTecmo\\Atelier Lydie and Suelle\\SAVEDATA\\SAVE DATA00.pcsave" GENERIC_WRITE  creation 2 attributes 0x80
0037:trace:file:RtlDosPathNameToNtPathName_U_WithStatus (L"C:\\users\\steamuser\\My Documents\\KoeiTecmo\\Atelier Lydie and Suelle\\SAVEDATA\\SAVE DATA00.pcsave",0x316af5d0,(nil),(nil))
0037:trace:file:RtlGetFullPathName_U (L"C:\\users\\steamuser\\My Documents\\KoeiTecmo\\Atelier Lydie and Suelle\\SAVEDATA\\SAVE DATA00.pcsave" 520 0x316af200 (nil))
0037:trace:file:wine_nt_to_unix_file_name L"\\??\\C:\\users\\steamuser\\My Documents\\KoeiTecmo\\Atelier Lydie and Suelle\\SAVEDATA\\SAVE DATA00.pcsave" -> "/home/samuel/.local/share/Steam/steamapps/compatdata/756590/pfx/dosdevices/c:/users/steamuser/My Documents/KoeiTecmo/Atelier Lydie and Suelle/SAVEDATA/SAVE DATA00.pcsave"
0037:trace:file:CreateFileW returning 0x48c
0037:trace:file:WriteFile 0x48c 0x322b88f0 1024 0x316adddc (nil)
0037:trace:file:WriteFile 0x48c 0x7f689e550d60 131072 0x316addec (nil)
0037:trace:file:WriteFile 0x48c 0x322b88f0 3968 0x316ade0c (nil)
ubuntor commented 5 years ago

Did some more investigating: that FIXME in SHCreateDirectoryExW changes the return value from ERROR_ALREADY_EXISTS to ERROR_CANCELLED, which seems incorrect in this case?

ubuntor commented 5 years ago

According to the MSDN, it seems like SHCreateDirectoryExW should only return ERROR_CANCELLED (and potentially display a dialog) when files are not visible.

ubuntor commented 5 years ago

Horrible cobbled-together testcase. Compiled with i686-w64-mingw32-g++ and tested on a WinXP VM.

WinXP output (No dialog was created.):

SHCreateDirectory, NULL hwnd: 183
SHCreateDirectory, actual hwnd: 183
SHCreateDirectoryExW, NULL hwnd: 183
SHCreateDirectoryExW, actual hwnd: 183

Wine output:

SHCreateDirectory, NULL hwnd: 183
0009:fixme:shell:SHCreateDirectoryExW Show system error message, creating path L"C:\\Windows\\Temp\\test", failed with error 183
SHCreateDirectory, actual hwnd: 1223
SHCreateDirectoryExW, NULL hwnd: 183
0009:fixme:shell:SHCreateDirectoryExW Show system error message, creating path L"C:\\Windows\\Temp\\test", failed with error 183
SHCreateDirectoryExW, actual hwnd: 1223
ubuntor commented 5 years ago

Workaround (only for Proton 4.2-3)

Extract and apply this patch to Proton 4.2/dist/lib64/wine/shell32.dll.so with bspatch. This patch essentially comments out these lines in shell32.dll. Saving works after patching!

ubuntor commented 5 years ago

Associated Wine bug

BillFleming commented 5 years ago

Confirmed that this patch fixes this issue for me. Also fixed the problem in another GUST game which I am putting in the report on now. Anyone out there who wants to use this patch make sure to change the permission on that shell32.dll.so file afterwards as Steam can/will change it back to the original version if you don't.

ubuntor commented 5 years ago

Fixed in Wine 4.7!