otavepto / gbe_fork

Fork of https://gitlab.com/Mr_Goldberg/goldberg_emulator
https://gitlab.com/Mr_Goldberg/goldberg_emulator
GNU Lesser General Public License v3.0
191 stars 55 forks source link

Elden Ring Achievements Freezes #91

Closed Pallina84 closed 3 months ago

Pallina84 commented 3 months ago

When i unlock achievements the game freezes a few seconds with release-2024_3_9 build and the older one, but with original goldberg build Achievements works normally without freezing the game.

otavepto commented 3 months ago

I assume the API to disable app input should not be called. This is one of the new states added in the updated overlay project.

This also happens for the game Summer Trip Cruise. If the assumption is correct, I'll figure something out.

This is what I suspect the most https://github.com/otavepto/gbe_fork/blob/1518075b17c9240dce5f76ef9c5ca45f71f9a48d/overlay_experimental/steam_overlay.cpp#L427

otavepto commented 3 months ago

Once Github finishes building, you can download and test the build artifact from the linked PR. I would suggest using the debug build in case something goes wrong.

Achievements and auto-accept popups shouldn't steal input focus, but invitations and chat messages should. Not sure about the last part though, let me know if it's annoying to let invitations and chat messages steal input focus.

Pallina84 commented 3 months ago

I tested last build artifact and the freeze is gone, there was only a microstutter when the achievement pop up.

otavepto commented 3 months ago

Nice, I'll merge this soon. The stutter happens, especially on DX12 games, since the image has to be loaded and scaled everytime. https://github.com/otavepto/gbe_fork/blob/1518075b17c9240dce5f76ef9c5ca45f71f9a48d/overlay_experimental/steam_overlay.cpp#L1537

I assume there might be a better way, but I never bothered to look at this part of the code.

otavepto commented 3 months ago

The micro-stutter problem was more difficult than I imagined. What I did as a workaround is loading all the achievements icons during startup, this will increase the game's startup time but won't lag the achievements popup menu, and won't cause micro-stutters when an achievement is unlocked.

Also the old code was loading the image from disk and resizing it every time to display the achievement unlock popup, despite it being already loaded in the achievements list/menu. So I changed it to use the already-cached image resource from the startup phase.

You can test the new changes when Github finishes building, same PR. Here's also the link for the Windows build: https://github.com/otavepto/gbe_fork/actions/runs/8285004873?pr=92

otavepto commented 3 months ago

Closing this one now, thanks for the report

Pallina84 commented 3 months ago

I restarted the game with last emu build and i re-unlocked the first 2 achievements and now it works fine, there is no microstutter anymore.