libretro / beetle-psx-libretro

Standalone port/fork of Mednafen PSX to the Libretro API.
GNU General Public License v2.0
305 stars 130 forks source link

[Beetle PSX HW] Silent hill cutscene with PGXP operation mode #490

Open Brh24 opened 5 years ago

Brh24 commented 5 years ago

This is a issue that has already been reported, when reaching a specific part in the game after a cutscene, during the dialogue the game freeze altogether example in the picture below.

silent hill usa -190226-192141

Now apparently this happen only if you have PGXP operation mode set with memory only.

I'm using 1.76 Beetle PSX HW with vulkan render, my specs are the following windows 10 64 bit, amd ryzen 5 1500 quadcore, 8gb ram, nvdia gtx 1050

inactive123 commented 5 years ago

@iCatButler This might be an interesting edge case issue for you.

rz5 commented 5 years ago

@Brh24 - Do you have a savestate of the game right before that bug happens? It would be helpful if you could share it here.

Brh24 commented 5 years ago

Silent Hill (USA).zip this should be it @rz5

iCatButler commented 5 years ago

This is related to PGXP intercepting the GTE's NCLIP operation and allowing triangles that would normally be degenerate to pass through and be rendered instead of culled. If I prevent this from happening then the cutscene plays as intended.

I think the actual root cause of the error is in the game itself not being able to handle the extra geometry rendering as similar corruption occurs if I enable the widescreen hack, with or without PGXP. It is also fixed if I set NCLIP to simply reject every other triangle, regardless of whether it would be culled or not.

In this case the game may be allocating a fixed size buffer to store all the draw calls for each frame (with double buffering) but not checking to see if these buffers overflow when draw calls are written into them. If one buffer overflows into the other it could corrupt the DMA chain currently being read by the GPU. Normally there would be no single scene with enough visible geometry to cause this, but with the widescreen or PGXP enabled it happens in this specific scene.

I'd be interested to know if this happens at all in PCSX-R or ePSXe, as their DMA chain behaviour is different. Pete's GPU plugins always try to process all nodes in the buffer without passing back execution to the CPU emulation, whereas Mednafen seems to alternate cycles on each to simulate them working in parallel.

PukeGX commented 4 years ago

Just wanted to add that the same problem occured with the software Beetle PSX with all default options, just widescreen hack on

Papermanzero commented 4 years ago

Can someone verify the issue with pcsx-r or epsxe?

rz5 commented 4 years ago

This bug is also caused by the widescreen hack

kosior555 commented 4 years ago

It also happened to me, can I know if something will be done about it? z x If we wait a bit, the conversation will go on but with glitch Video: https://streamable.com/5ljsn

boomercore commented 4 years ago

Confirming and bumping what's already been discovered. This is trigged by the widescreen hack in particular, and it happens in software, GL, and Vulkan on both the software-only and HW flavors of the core at any rendering resolution. It's a shame, as the game is BEAUTIFUL in Vulkan with unfiltered textures, PGXP, in widescreen HD.

There are other moments where this is triggered as well. Like on the bridge when you grab the health drink there. Upon examining the item it will lock up. Fine with PGXP + WS off.

DD-Indeed commented 4 years ago

Confirming too that this still happens on the Church and Bridge cutscenes, and there's also dialogue out of sync in Alessa/Dahlia-cutscene at Amusement Park. Simply put: the game has just way too much geometry going on in those scenes, so that the PGXP/emulator overloads too much from it. Even original hardware struggles in these two scenes. So far the only solution is to disable Widescreen Hack and PGXP.

But, could there be possibility to have sort of adaptive system to it, or perhaps some limiting parameters available, where you could adjust the PGXP limits etc ?

Of course we can just revert the settings closer to stock ones, but for the sake of enjoyable, undisrupted game session, that's annoying.

This has to be fixed somehow, since the game looks and runs beautifully otherwise, and is superb gaming experience.

Edit: I'm also asking some help from GameHacking Discord that is there any ways to disable some effects from the game, gotta try that too, disabling snow for example etc.

Tux-Prowess commented 3 years ago

I've tried Duckstation with PGXP geometry correction on but with PGXP culling correction disabled. That seems to fix the cutscene with D.G. in the church.

Kappa971 commented 8 months ago

I've tried Duckstation with PGXP geometry correction on but with PGXP culling correction disabled. That seems to fix the cutscene with D.G. in the church.

Same problem and same "solution" found. I enabled all PGXP options except "culling correction" and "buffer depth", with these options the church cutscene doesn't crash. "Widescreen hack" also causes the crash.

image I'm playing the European (PAL) version of Silent Hill (SLES-01514).

This is the savestate (just outside the church): SLES-01514_1.zip

There's no way to report the issue in Duckstation's github repository, and I don't know if the developers are aware of the issue (and if it's fixable). @stenzek should be the lead developer, if he doesn't know about it, maybe he could read about the issue in this discussion.

DD-Indeed commented 7 months ago

Further testing with this after some time, I changed the Dynarec Code Invalidation setting from Full to DMA. That fixed slowdowns in some rooms when having that 60fps hack on, and it actually fixed the bridge lowering-cutscene after the church. Previously, the bridge lowering also crashed the game if you had PGXP and/or Widescreen hack enabled. But, the framerate still dips in that bridge-cutscene to around 40fps, no idea why. There's also random dips in some locations, like in the bus next to the school, no matter how high you go with the core overclock, it doesn't run past 57fps.

Testing further to see that does it crash the game in the amusement park cutscenes, so far it's been smooth sailing apart from that church cutscene.

Edit: Okay, finished the game, and it didn't crash after the church at all. The only moments where it did get little haywire were some of the cutscenes on the amusement park, framerate did dip down to 28fps in one moment, dialogue-subtitle sync went off and the game basically didn't load up the next event until you pressed Start to skip/end the cutscene. Last time there was these errors was with the last cutscene with Lisa. Final battle cutscenes had only couple fps drops, but worked otherwise just fine.

Hopefully this info would lead to fixes with the game running properly on emulators.