protonscr

SMT3 HD: Black screen when entering shop/save rooms the second time

dxvkclosed d3d11
doitsujin/dxvk#2161 · opened 2021-07-14 by junglerobba · updated 2021-08-06 · 16 comments · github
Jjunglerobba 2021-07-14 github

As described in https://github.com/ValveSoftware/Proton/issues/4843 the game goes to a black screen (music still playing) when entering save rooms or shops the second time. Also happens on Windows when using dxvk, and works fine when using wined3d, so I'm assuming dxvk has something to do with it.

Software information

Shin Megami Tensei III Nocturne HD Remaster

System information

  • GPU: RX 5700XT
  • Driver: Mesa 21.1.4
  • Wine version: Proton Experimental
  • DXVK version: 1.9

Apitrace file(s)

The game was too slow with apitrace on Windows to get past the main menu (trailer kept starting to play before I was able to enter the menu), but ran at normal speeds on Proton, so I hope the trace is fine. Since the bug does not actually happen on wined3d i just entered some save rooms a bunch of times in the hopes that something in there would point to the issue.
https://drive.google.com/file/d/1gCzhSoyzjy2Escl9o86bAM2Y8Q0duQYL/view?usp=sharing

Log files

Ddoitsujin maintainer 2021-07-14 github

Trace replays fine on my end.

Is there a way to reproduce the issue when starting a new game, or can you share a savegame?

Jjunglerobba 2021-07-15 github

The first save room is after the intro, about 10-20 minutes in.
Here's a save just in case though. Slot 3 in Shibuya works best, just enter any of the doors with symbols on them, and on the second time entering it should happen.
SMT3HDDATA.zip

Ddoitsujin maintainer 2021-07-15 github

Where do I need to put this? I put it into .steam/steam/steamapps/compatdata/1413480/pfx/drive_c/users/steamuser/Application Data/Sega/smt3hd/(userid) as suggested by PCGW, but the game does not seem to pick it up.

Jjunglerobba 2021-07-15 github

The path should be pfx/drive_c/users/steamuser/AppData/Roaming/Sega/SMT3HD/<userid>, but I'm not at my pc to check at the moment.

Ddoitsujin maintainer 2021-07-15 github

Paths on wine are usually different, the game has not created any directory in AppData/Roaming but instead in the directory that I posted above.

Anyway, I do not understand how to play the game and I don't want to waste a whole bunch of time trying to learn it just to get to a save point, so we kind of need to figure this out.

Ddoitsujin maintainer 2021-07-15 github

Game just deadlocks somewhere in its own code, no idea how to debug this. I guess wined3d is the only solution for now.

Ddominic-jones 2021-07-19 github

Anyway, I do not understand how to play the game and I don't want to waste a whole bunch of time trying to learn it just to get to a save point, so we kind of need to figure this out.

I can provide a save file if you still need one. Your later comment implies you've already looked at it though. Do you still need it?

Qqchto 2021-07-19 github

Game just deadlocks somewhere in its own code, no idea how to debug this. I guess wined3d is the only solution for now.

Thanks for the effort, WINED3D does work as an isolated solution, but sadly performance drops noticeably and even worse introduce its own bug: an unaccessible Steam Overlay.

Now, just to keep track of this error, is it possible the game is setting something the first time it enters the room? Such as the second time an "invalidation" of said change creates the deadlock?

Jjunglerobba 2021-07-26 github

So just out of curiosity I tested with some older versions of dxvk and it turns out that the bug appeared somewhere between v1.4.5 and v1.4.6. Unfortunately these versions will not compile on my system anymore, so I cannot bisect the exact commit (not sure this is useful in any way)

Aaeikum 2021-07-27 github

@junglerobba Thanks for the clue. I was able to bisect it down to this commit:

commit 9785fba66ef4b76392dfdc6d5a109f4b628f9ad2
Author: Philip Rebohle <[email protected]>
Date:   Tue Nov 26 01:17:22 2019 +0100

    [dxgi] Implement IDXGISwapChain2::GetFrameLatencyWaitableObject

Surprisingly, it reverts cleanly on top of v1.9.1. Reverting the commit fixes the hang in SMT3.

Aaeikum 2021-07-27 github

Steps to reproduce (starting from a clean prefix):

  1. Run the game once to create the prefix. Get to the "Load Game" screen so the game creates its save data directories. Quit the game.

  2. Download this file: SMT3HDDATA.sav.zip and extract the .sav file.

  3. Put that .sav file in .../steamapps/compatdata/1413480/pfx/drive_c/users/steamuser/AppData/Roaming/Sega/SMT3HD/<your steam3 id>/. This directory should already exist.

  4. Run the game and load either save.

  5. Turn around and you will see a door with a red symbol on it. Enter the door with the space bar. Use the menu item to Exit. Then turn around and enter the door again. The game will hang here.

MMrPeteypoo 2021-07-28 github

I tried a few things and can also confirm that the game works great with 1.4.5 but breaks with 1.4.6. I did the following steps:

  1. Downloaded Proton-6.8-GE2 from here: https://github.com/GloriousEggroll/proton-ge-custom/releases/tag/6.8-GE-2
  2. Extracted it to ~/.steam/root/compatibilitytools.d/Proton-6.8-GE-2
  3. Downloaded DXVK 1.4.5 from here: https://github.com/doitsujin/dxvk/releases/tag/v1.4.5
  4. Extracted it and overwrote the version of DXVK bundled with Proton-6.8-GE-2: cp dxvk-1.4.5/x64/*.dll ~/.steam/root/compatibilitytools.d/Proton-6.8-GE-2/files/lib64/wine/dxvk/
  5. Ran the game with DXVK_HUD=full %command%
  6. Confirmed that the HUD shows I'm using 1.4.5
  7. Confirmed that I can enter and exit a save room as many times as I wish

When I do the above steps with 1.4.6 I get the black screen issue that is present in 1.9.1. As an aside, the reason I used Proton-6.8-GE-2 is because it allows movies to be played. This way movies work in the game and we get to use DXVK so we don't get horrible gradients from WINED3D.

Ddoitsujin maintainer 2021-08-02 github

Should be fixed in https://github.com/doitsujin/dxvk/tree/dxgi-semaphore. Turns out that frame latency "events" aren't actually events and have some quirks that the game seems to be trying to work around, and wined3d works because it does not support the feature in the first place.

Gonna merge that branch soon if it doesn't break anything.

Aaeikum 2021-08-02 github

I can confirm that branch fixes it for me (tested 5a12b253f8b830ce7b3cd2930669d0802a4d88c8).

MMrPeteypoo 2021-08-03 github

Great work everyone for diagnosing the issue and doitsujin for fixing it, I've been playing with 1.4.5 and its been working well but it'll be great to have it work out of the box :D

Aaeikum 2021-08-04 github

FWIW there are now Wine tests showing this object should be a semaphore: https://source.winehq.org/git/wine.git/commitdiff/39f2398913d8de02261b42d540efc803694832eb

Proton versions

Launch options

Launch lines

Upstream links