ValveSoftware / Proton

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

Bayonetta (460790) #262

Open mrdeathjr28 opened 6 years ago

mrdeathjr28 commented 6 years ago

Seems wine error still remains, this game cant load second time because lack of this feature

https://bugs.winehq.org/show_bug.cgi?id=42982

Also affects vanquish

kisak-valve commented 6 years ago

[GREYLIST] Bayonetta (460790)

Issue transferred from https://github.com/ValveSoftware/Proton/issues/693. @mimattr posted on 2018-08-26T18:40:47:

Ubuntu 16.04, NVIDIA GTX 970, Proton 3.7-4 Beta:

Steam System Information

Test Result
Singleplayer Working^
Local Co-op N/A
Online Multiplayer N/A
Configuration ...
Input Steam Controller
Display 1920x1080
Fullscreen Yes
Preset Medium
VSync On^^
API DX9

^ CRIWARE “Filmstrip” cutscenes display incorrectly ^^ Disabling “VSync” causes application freeze (#262)


@Zero86Sk commented on 2018-08-26T19:21:49

i would say this is not whitelist worthy yet


@mimattr commented on 2018-08-26T19:39:35

@Zero86Sk Please note this is a GREYLIST item (i.e. near feature complete), the WHITELIST should be reserved for fully functional products.

MuchiMuchiPink commented 6 years ago

Wonder if this is fixed yet? In Vanquish it is possible now to change resolution etc, while Bayonetta still crashed.

Francesco149 commented 5 years ago

I'm still observing the issue as of now with proton 3.16-3 beta on a r9 270x with mesa-git and kernel 4.18.14-zen

popsUlfr commented 5 years ago

Yes, with 3.16-3 beta changing the graphics options either crash the game or it says it can not save the changes. Also the start screen and main menu look like this for me : 460790_20181027112001_1 460790_20181027112008_1

It's maybe because of the Nvidia beta drivers 396.54.09. Sometimes when starting the game the Bayonetta logo appears correctly it's like 1/10 times though.

NTMan commented 5 years ago

Bayonetta crashed immediately after start on AMD Vega 56.

screenshot from 2018-10-27 23-48-06

steam-460790.log

$ inxi -bM
System:    Host: localhost.localdomain Kernel: 4.19.0-1.fc30.x86_64 x86_64 bits: 64 Desktop: Gnome 3.30.1 
           Distro: Fedora release 30 (Rawhide) 
Machine:   Type: Desktop Mobo: ASUSTeK model: ROG STRIX X470-I GAMING v: Rev 1.xx serial: <root required> 
           UEFI: American Megatrends v: 0901 date: 07/23/2018 
CPU:       8-Core: AMD Ryzen 7 2700X type: MT MCP speed: 1996 MHz min/max: 2200/4000 MHz 
Graphics:  Device-1: Advanced Micro Devices [AMD/ATI] Vega 10 XL/XT [Radeon RX Vega 56/64] driver: amdgpu v: kernel 
           Display: wayland server: Fedora Project X.org 1.20.2 driver: amdgpu resolution: 3840x2160~60Hz 
           OpenGL: renderer: Radeon RX Vega (VEGA10 DRM 3.27.0 4.19.0-1.fc30.x86_64 LLVM 7.0.0) v: 4.5 Mesa 18.2.2 
Network:   Device-1: Intel I211 Gigabit Network driver: igb 
           Device-2: Realtek RTL8822BE 802.11a/b/g/n/ac WiFi adapter driver: r8822be 
Drives:    Local Storage: total: 11.35 TiB used: 5.64 TiB (49.7%) 
Info:      Processes: 459 Uptime: 44m Memory: 31.34 GiB used: 19.23 GiB (61.4%) Shell: bash inxi: 3.0.27 
ghost commented 5 years ago

https://github.com/wine-mirror/wine/commits/master/dlls/ntdll/file.c https://www.phoronix.com/scan.php?page=news_item&px=Wine-3.19-Released

There's been a lot of changes to the relevant file in Wine causing this bug, not sure if it effects this.

It'd be great if someone could test this game again on Wine 3.19 or git.

popsUlfr commented 5 years ago

I tested with wine 3.19 and git (EDIT2 : just realized that the latest git commit was to tag 3.19, so that was useless haha) and still the same problem with the saving of the options

screenshot_20181028_110230

~But since 3.19 no graphic issues on my end with the main menu~

460790_20181028110522_1

At least I think, I don't know what it looks like on windows.

EDIT3: I was wrong. It's still random with the graphics glitches.

EDIT: Here's a wine trace but I don't think it's very useful (remove the last .log at the end) steam-460790.log.xz.log

EDIT4: I applied the patch from the wine bug report https://bugs.winehq.org/show_bug.cgi?id=42982 found here https://bugs.winehq.org/attachment.cgi?id=58637&action=edit

But the error still persists.

Francesco149 commented 5 years ago

another quite annoying bug is that pause often softlocks at the loading... text

EDIT: spamming kick/punch for a couple seconds unlocks the game, still annoying though

popsUlfr commented 5 years ago

I compiled my own proton with the patch applied and I can change the settings. Anything higher that 1280x720 crashes the game though. Also the game completely bypasses an emulated desktop???? It crashes randomly while loading :( Because of the autosaving I presume...

EDIT: Here's the patched 32bit ntdll.dll.so if someone wants to do some testing. It would need to be dropped where the existing 32bit ntdll.dll.so is located. So for Proton 3.16 that would be ~/.local/share/Steam/steamapps/common/Proton 3.16/dist/lib/wine/ntdll.dll.so always backup the original file. It would be nice if there were a way to LD_PRELOAD the library but I haven't figured out how to work this out.

Applied patch ntdll-file-async.v3.patch : ntdll.dll.so.gz

EDIT2:

Wait, so if you work your way up in the resolutions starting with 1280x720 and applying each higher resolution you can get up without crashing! :D

460790_20181031134716_1

(The screenshot is 2560x1440, my monitor is 1440p, the game seems to upscale 1080p regardless and renders at native resolution if that makes sense...)

Can the system_data file be shared ? Why encrypt this it's beyond me. This file has all graphics at max, vsync off, resolution at 1920x1080. Goes into ~/.local/share/Steam/steamapps/compatdata/460790/pfx/drive_c/users/steamuser/My Documents/Bayonetta/system_data 1920x1080, All Max, Vsync off : system_data.gz 2560x1440, All Max, Vsync off : system_data.gz

The game WILL get stuck on start if the patched ntdll.dll.so isn't used by the way.

My launch options are : PROTON_NO_D3D11=1 %command%

1440p :

460790_20181031143340_1 460790_20181031143353_1

popsUlfr commented 5 years ago

Made a LD_PRELOAD hack for easy loading without having to alter the proton dist for all the games. Here's the source code for ntdll_override.c : https://gist.github.com/popsUlfr/363a6a0bf981cc2ae4308bf2cf0758fb To compile yourself : gcc -m32 -O2 -Wall -shared -fPIC -ldl -o ntdll_override.so ntdll_override.c

Extract the following next to Bayonetta.exe ~bayonetta_ntdll_override.tar.gz~ ~(If the first one does not work then here's a ntdll_override.so that is compiled with gcc from the steam runtime : bayonetta_ntdll_override_steamgcc.tar.gz)~ bayonetta_ntdll_override_3.16-6.tar.gz

So it looks like this :

Bayonetta.exe
ntdll.dll.so
ntdll_override.so

In the launch options for the game set :

LD_PRELOAD="${LD_PRELOAD}:./ntdll_override.so" PROTON_FORCE_LARGE_ADDRESS_AWARE=1 PROTON_NO_D3D11=1 %command%

(also add PROTON_FORCE_LARGE_ADDRESS_AWARE=1)

oblitum commented 5 years ago

I'm on Intel HD 7700K, game launches but it's slow for my setup, but if I try to change graphic settings it crashes, and I can't set lower graphics and resolution. If anyone knows a simple alternative way to have this fixed. Otherwise no problem, I can wait. Vanquish is at the same state.

popsUlfr commented 5 years ago

@oblitum Can you try my "hack" ? https://github.com/ValveSoftware/Proton/issues/262#issuecomment-434778758

It should be able to save the settings this way, set the resolution to 1280x720 first before trying to change any other setting. Once that is saved you ~can~ should be able to change the other graphics settings.

oblitum commented 5 years ago

@popsUlfr I didn't go for it at first because it looked like requiring compilation? I just wish to set environment or game launch options. If I need to copy some binary ok. I'll read it carefully.

MuchiMuchiPink commented 5 years ago

@oblitum what's your mesa version? Because the same bug happened in Vanquish on older versions, but it was fixed with 18.2.

oblitum commented 5 years ago

@popsUlfr I'm trying your hack, I've copied a local ntdll.dll.so to the Bayonetta folder and compiled ntdd_override.so and copied it there too, it worked for setting graphic options! But I forgot to follow your last tip regarding saving the resolution setting first, I changed other stuff and now the game won't even launch, it gets stuck in a black window on launch :'( Do you know where to cleanup settings to try it again :-/ ?

@MuchiMuchiPink I'm on mesa 18.2.3 on ArchLinux. Vanquish simply crashes when I go to game options.

MuchiMuchiPink commented 5 years ago

@oblitum alright, I'm on Arch as well, but Vanquish does not have this bug anymore since 18.2. However I have an AMD iGPU. Have you tried it in borderless mode? I think that's required to make it work.

oblitum commented 5 years ago

@MuchiMuchiPink how to set borderless mode for it?

oblitum commented 5 years ago

@MuchiMuchiPink no need for that! @popsUlfr's fix works for Vanquish too :) I've just entered game options and it didn't crash, and I was able to lower resolution and save settings without problems. I couldn't still recover Bayonetta though, will wait for any tip, otherwise I will just download it again sadly.

popsUlfr commented 5 years ago

@oblitum You didn't need to compile it yourself, I only added this info so anyone can reproduce the build. I made an easy to use archive with everything needed in it bayonetta_ntdll_override_steamgcc.tar.gz.

If it really stays stuck on launch then delete the system_data that stores the options. So

rm ~/'.local/share/Steam/steamapps/compatdata/460790/pfx/drive_c/users/steamuser/My Documents/Bayonetta/system_data'

should work.

oblitum commented 5 years ago

@popsUlfr Thanks, that worked to reset the state. I've launched the game again, and lowered the resolution alone and saved, but the same thing happened, when I confirm to save the new graphics settings, the game gets stuck. As I've commented earlier, Vanquish is getting better results with your hack than Bayonetta for me. As I did earlier, I had to pkill Bayonetta.exe and tried to launch it again but now it's in the same frozen state when launching.

popsUlfr commented 5 years ago

@oblitum Ok, just to double check your launch options look like this right ?

LD_PRELOAD=./ntdll_override.so PROTON_NO_D3D11=1 %command%

Go into the properties, Updates tab and uncheck Enable Steam Cloud synchronization for Bayonetta screenshot_20181031_202604

Now delete it again if present

rm ~/'.local/share/Steam/steamapps/compatdata/460790/pfx/drive_c/users/steamuser/My Documents/Bayonetta/system_data'

And retry changing settings.

oblitum commented 5 years ago

@popsUlfr ah, weird, sorry... hmm as I commented earlier, I've compiled the ntdll_override.so myself, and used a local ntdll.dll.so. I did that because I prefer to avoid 3rd part binaries, so, sorry, I caused some confusion on that, reading the thread now I see you produced a patched ntdll.dll.so. So, I think, since I didn't get the patched ntdll.dll.so and Vanquish is now working, it should be because of the launch options and that alone for it suffices. That alone is not enough for Bayonetta, I can get to graphics settings, but it's not saved.

So here on my system I will try Vanquish without loading ntdll.dll.so, just leaving the remaining launching options regarding D3D11 and see if it still works. And get your DLL for Bayonetta.

Francesco149 commented 5 years ago

@popsUlfr I tested your LD_PRELOAD hack (first version) and it works great as long as I have PROTON_NO_D3D11=1

the settings are correctly saved and loaded on subsequent starts

running high settings will result in more glitchy/missing textures though, while medium is fine througout the game except for a few menus and one boss where the water is transparent

I'm running mesa-git and amdgpu on a r9 270x

popsUlfr commented 5 years ago

@oblitum Yeah Vanquish works out of the box for me, changing settings and all on nvidia. Bayonetta has still some peculiar file saving problems compared to Vanquish it seems. You can compile the patched ntdll.dll.so yourself of course. Just need to pull this repo, patch the wine folder with the diff from the wine bug report and follow the instructions for building yourself. As a convenience I offered those already built and ready for testing.

@Francesco149 Ah great to hear! Yeah I mentioned the option PROTON_NO_D3D11=1 to be set in the launch options. I created the second tarball because I remembered that a more recent glibc version might create versioning issues on older libc systems, the steam runtime version should therefore work on any distro where steam can be installed I think.

oblitum commented 5 years ago

@popsUlfr OK, thanks. So I tried all again, and yeah, Vanquish just needs PROTON_NO_D3D11=1 %command% to work fine. Regarding Byonetta, and tried your two ntdll.dll.so but in all cases Bayonetta crashed as soon as it launched (can't even see the game window launching at all).

popsUlfr commented 5 years ago

@oblitum Ok, try these :

  1. Make sure system_data is deleted before launching.
  2. Set the launch options to
    PROTON_LOG=1 PROTON_DUMP_DEBUG_COMMANDS=1 LD_PRELOAD=./ntdll_override.so PROTON_NO_D3D11=1 %command%

    This will create ~/steam-460790.log so check it out for any errors.

  3. Does winecfg work ? proton debug scripts will be dropped into /tmp/proton_*/. Try to run
    /tmp/proton_*/run winecfg

    And

    LD_PRELOAD=/PATH/TO/ntdLL_override.so /tmp/proton_*/run winecfg

    Look at the output.

oblitum commented 5 years ago

Hi, I don't have wine standalone nor winecfg in my path... Thanks for the instructions, I think I'll just wait a bit more time, at least Vanquish is fine.

popsUlfr commented 5 years ago

@oblitum You don't need wine installed for this to work. The scripts expose proton so you can launch anything in the wine prefix like winecfg. There's maybe a symbol mismatch or something that could be pointed to with the logs. Looking into /tmp/dumps/*_stdout.txt might also give some pointers.

oblitum commented 5 years ago

@popsUlfr I got this for the log

ERROR: ld.so: object './ntdll_override.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object './ntdll_override.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
wine client error:0: version mismatch 557/568.
Your wineserver binary was not upgraded correctly,
or you have an older one somewhere in your PATH.
Or maybe the wrong wineserver is still running?

I was now using your ntdll_override.so, but same happens if I compile it myself.

popsUlfr commented 5 years ago

@oblitum Does Steam Play in your steam settings look like this ?

screenshot_20181031_210617

In any case switch to another Compatibility Tool version restart steam. Once back in steam set the compatibility version to Proton 3.16-3 Beta and restart steam. There's something wrong with the wine prefix.

oblitum commented 5 years ago

I'm using the Beta program, also, I'm using steam-native. I can't restart steam now sadly, I have to wait a game to finish downloading otherwise it starts all over again and it's too big. Will have to wait some hours for that. But, it's already in beta participation.

oblitum commented 5 years ago

Ops, it looks like I have to update that tab since I lastly applied it. The last check box isn't checked anymore, and the Compatibility tool is at Proton 3.7-8 while 3.16 is already available. Maybe this would update on a pending restart my client is waiting for. But I'll have to wait anyways, so, see ya later for the report, thanks for all the help so far :-)

oblitum commented 5 years ago

OK, back to report.

After updating the steam client and the compatibility tool to Proton 3.16-3 Beta, @popsUlfr's hack is now working \o/

What I've noticed, PROTON_NO_D3D11=1 alone prevents the Bayonetta crash when I try to reach the graphics settings, but I still can't save the setting changes, the game gets stuck, so then the patched ntdll fixes this.

Thanks!

popsUlfr commented 5 years ago

@Francesco149

running high settings will result in more glitchy/missing textures though, while medium is fine througout the game except for a few menus and one boss where the water is transparent

I'm running mesa-git and amdgpu on a r9 270x

I haven't noticed graphical issues on nvidia yet while running in 1440p. Could you post some screenshots of the problems ?

EDIT: With the new Proton 3.16-4 the game has dropped all the frames on me for some reason :( What happened ?? No performance issues in 1440p on 3.16-3, it's quite bad now.

By the way the launch options should look like this to have a working steam overlay

LD_PRELOAD="${LD_PRELOAD}:./ntdll_override.so" PROTON_NO_D3D11=1 %command%

EDIT2: I nuked the prefix steamapps/compatdata/460790 and recreated a system_data but I can only get up to 2560x1080 before it always crashes. I switched back to 1920x1080 and am getting the same performance as before at that resolution. The crazy thing is that if I use the system_data I uploaded earlier with the exact same settings (1920x1080 max settings) as I have now the framerate tanks completely. I am completely baffled.

Francesco149 commented 5 years ago

@popsUlfr after more experimentation the graphical glitches only occur when I change quality while in-game. if I restart the game and change the graphics from the main menu and then start a chapter high settings work great. custom settings seem to always cause graphical glitches. will get some screenshots when I have time

ghost commented 5 years ago

Could I patch regular wine and compile it, then drop in that ntdll.dll.so?

Would this have to be compiled again every time Proton updates?

popsUlfr commented 5 years ago

@z0z0z I'm not sure I follow, if you patch wine and compile then you already have the ntdll.dll.so with the fix ? If there are some big changes in future versions regarding the ntdll.dll source code then it might not work. For instance this ntdll.dll.so compiled from the 3.16 proton source doesn't seem to work with proton 3.7.

The best course of action of course is to get proper async file io into upstream wine, but since the time the patch was proposed the devs didn't seem too fond of the implementation. In the meantime Vanquish got to a working state regarding the file io, but Bayonetta might not do the proper error checking but still works on windows because of lenient programming in the windows dlls ?

Other than that the game also has dx9 issues that make it so fragile and prone to crashes which also deserve more investigation.

ghost commented 5 years ago

@popsUlfr

I was just wondering if I could clone the real Wine git repo and compile it with the patch, and use that ntdll.dll.so, or if I really need the same version of Wine that proton 3.16 is using for example.

Anyway I'm going to try this and your C program for LD_PRELOAD and then post results. Thank you for all the work you've done getting this game to work.

popsUlfr commented 5 years ago

@z0z0z This would need some testing indeed. There will most likely be versioning issues if the internal wine API changes. Preloading an entire ntdll.dll like this is quite ugly, I was looking at somehow only extracting the relevant parts and injecting that but there is a lot depending on the other parts of that dll. Also ntdll.dll is quite the critical part of wine, meddling with the read/write operations could cause corruption if it were to be used system wide. For the game it has a beneficial effect though. At least sorta preloading it like this limits its effects to only the game instead of having a potential time bomb in the global wine installation :)

All thanks should be directed at Toni from the bug report on the wine bugzilla who came up with the patch. I just wanted to make it more convenient with that preload hack.

mrdeathjr28 commented 5 years ago

@popsUlfr

With patch save config without issues and start game for second time use config saved settings without issues too

tycho commented 5 years ago

Yes, with 3.16-3 beta changing the graphics options either crash the game or it says it can not save the changes. Also the start screen and main menu look like this for me : 460790_20181027112001_1 460790_20181027112008_1

So I have some fixes in the pipeline for this in particular. The problem is that Bayonetta runs out of available address space while allocating texture memory. Bayonetta is a 32-bit application with only 2GB of available address space, because it doesn't have the LARGE_ADDRESS_AWARE bit set in the PE header. So I've got a Wine patch I wrote which can fix this issue and I'll be trying to get it in an upcoming Proton 3.16 beta build.

The other issue (the settings save issue) is more complicated. I tried the patch named "Alternative2: Do read/write really asynchronous v3" mentioned in Wine's bug tracker, but in my testing I found that this patch causes regressions on several other games. For the moment I don't have a good fix for that. But as a horrid workaround you can tell Bayonetta to save settings, then Alt-F4 and reopen the game, and the settings should be applied (I know, it sucks).

popsUlfr commented 5 years ago

@tycho

So I have some fixes in the pipeline for this in particular. The problem is that Bayonetta runs out of available address space while allocating texture memory. Bayonetta is a 32-bit application with only 2GB of available address space, because it doesn't have the LARGE_ADDRESS_AWARE bit set in the PE header. So I've got a Wine patch I wrote which can fix this issue and I'll be trying to get it in an upcoming Proton 3.16 beta build.

Oh very cool. Do you have a link for the patch so we can test too ? Is the address space the only thing causing the graphical issues ?

The other issue (the settings save issue) is more complicated. I tried the patch named "Alternative2: Do read/write really asynchronous v3" mentioned in Wine's bug tracker, but in my testing I found that this patch causes regressions on several other games. For the moment I don't have a good fix for that. But as a horrid workaround you can tell Bayonetta to save settings, then Alt-F4 and reopen the game, and the settings should be applied (I know, it sucks).

Yeah, the patch is a bit dangerous to use in a global wine install. It fixes the save issues fine for Bayonetta though, that's why I shared an LD_PRELOAD hack earlier in the thread so that only the game uses the fix. Bayonetta seems to be and edge case in the regard to the async io, Vanquish doesn't have issues anymore.

youwereeatenbyalid commented 5 years ago

For those looking for a texture solution in the meantime, you could just use a program to set the LARGE_ADDRESS_AWARE bit in the executable yourself.

Use the program in this thread here: https://www.techpowerup.com/forums/threads/large-address-aware.112556/

I did an initial test running through a few levels and it seems to have fixed all issues so far.

Be aware that this entire fix is broken for the new Proton 16.5-Beta. Use 16.4 instead.

EDIT: Force Large Address Aware has been added as an option to proton! Use that option to fix textures instead!

NTMan commented 5 years ago

Good news the game works out of box with Proton 3.16-6 Beta. steam-460790.log screenshot from 2018-12-22 19-15-22

$ inxi -bM
System:    Host: localhost.localdomain Kernel: 4.20.0-0.rc7.git1.1.fc30.x86_64 x86_64 bits: 64 Desktop: Gnome 3.31.2 
           Distro: Fedora release 30 (Rawhide) 
Machine:   Type: Desktop Mobo: ASUSTeK model: ROG STRIX X470-I GAMING v: Rev 1.xx serial: <root required> 
           UEFI: American Megatrends v: 1103 date: 11/16/2018 
CPU:       8-Core: AMD Ryzen 7 2700X type: MT MCP speed: 3936 MHz min/max: 2200/3700 MHz 
Graphics:  Device-1: Advanced Micro Devices [AMD/ATI] Vega 10 XL/XT [Radeon RX Vega 56/64] driver: amdgpu v: kernel 
           Display: wayland server: Fedora Project X.org 1.20.3 driver: amdgpu resolution: 3840x2160~60Hz 
           OpenGL: renderer: Radeon RX Vega (VEGA10 DRM 3.27.0 4.20.0-0.rc7.git1.1.fc30.x86_64 LLVM 7.0.1) v: 4.5 Mesa 18.3.1 
Network:   Device-1: Intel I211 Gigabit Network driver: igb 
           Device-2: Realtek RTL8822BE 802.11a/b/g/n/ac WiFi adapter driver: r8822be 
Drives:    Local Storage: total: 11.38 TiB used: 7.58 TiB (66.6%) 
Info:      Processes: 505 Uptime: 7h 25m Memory: 31.35 GiB used: 15.27 GiB (48.7%) Shell: bash inxi: 3.0.29 
oblitum commented 5 years ago

OK, my case is the reverse, the game worked previously, it doesn't anymore, stuck launching, or if trying the ntdll_override.so, simply gets closed early (the fix wasn't needed for it to launch before either).

kisak-valve commented 5 years ago

Hello @oblitum, please add PROTON_LOG=1 %command% to the game's launch options and drag and drop the generated $HOME/steam-$APPID.log into the comment box.

youwereeatenbyalid commented 5 years ago

It's because the settings have been messed with already.

go to /home/(username)/.steam/steam/steamapps/compatdata/460790/pfx/drive_c/users/steamuser/My Documents/Bayonetta and delete the system_data file.

@kisak-valve it's looking like adjusting graphics options still causes the game to crash on any subsequent runs.

oblitum commented 5 years ago

@youwereeatenbyalid many thx, that fixed the stuck on load issue.

Same problem as before on saving graphics settings, it gets stuck on save. Afterwards the game can't launch anymore.

oblitum commented 5 years ago

The fix won't work anymore as is, probably needs recompilation.

oblitum commented 5 years ago

@NTMan can you check whether you can change graphics settings and save it?