Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlay not closing the game #23

Open
OdinIsLord opened this issue Jun 22, 2023 · 16 comments
Open

Overlay not closing the game #23

OdinIsLord opened this issue Jun 22, 2023 · 16 comments
Labels
bug Something isn't working

Comments

@OdinIsLord
Copy link

When exiting a game via the steam overlay in big picture mode, only the overlay closes leaving the game running. I have the option checked in Playnite and the option to close GlossI when app quits and vice versa checked in GlossI Config. Tried with emulated and standalone games, same result. Maybe I'm doing something wrong.

@LemmusLemmus
Copy link
Owner

LemmusLemmus commented Jun 22, 2023

I just had this issue today too and was wondering if anyone else would have it as well :(. It seems like the new Steam update changed how games are closed via the overlay. Before Steam would simply forcefully kill the game (i.e. GlosSITarget), resulting in an exit code of 1. Now Steam appears to (at least attempt to) close the game gracefully, which results in an exit code of 0. This is problematic because the extension checks the exit code to differentiate between the user closing the overlay via for example the taskbar (in which case I consider it unexpected to kill the game as well) or via the Steam overlay.

The easiest solution would be to simply not differentiate between the two scenarios, and always close the game if GlosSITarget is closed, regardless of how. Either way, a fix will have to come in the next version of the extension.

@LemmusLemmus LemmusLemmus added the bug Something isn't working label Jun 22, 2023
@OdinIsLord
Copy link
Author

OdinIsLord commented Aug 15, 2023

@LemmusLemmus So after some time I went back and looked at this issue and I think I found out why the overlay wasn't closing the games.

If you set a setting to "x" in the Playnite extension by editing the DefaultTarget.json file and at the same time have the global setting in GlosSIConfig set to "y" then after the extension makes an integration to a game and creates a shortcut, it will execute the extension' setting although it shows the global settings as enabled in GlosSIConfig.

For example, I had "closeOnExit" set to false in the extension, and had the same option enabled in GlosSIConfig in the global settings for new shortcuts. It shows that close on exit option is enabled when you click on edit settings but it will still execute the extension' setting.

What made it work was disabling the option in GlosSIConfig, restarting steam, enabling it again, restating steam. Or just set the correct setting in the DefaultTarget.json file before enabling the integration for the game, but silly me didn't know it would override GlosSIConfig.

So now, it would be very helpful to know all the setting options for the DefaultTarget.json file, for example the option to disable GlosSI overlay without disabling the steam overlay. Can't find it in the file.

@LemmusLemmus
Copy link
Owner

I have actually solved the issue since a while back (via what I previously described as the "easiest solution"), I just haven't released the updated version yet...

I'm unsure how you made it work. The "closeOnExit" setting in the GlosSITarget settings and the Playnite extension is actually completely separate. The Playnite extension never informs GlosSITarget of what the game actually is, and handles the game closing entirely itself.

The DefaultTarget.json file is used as a template when adding new integrations. Since I first added it, new options have been added to GlosSI such as the option to disable the GlosSI overlay. You can simply add a line of text for the option in the file. All settings available in the latest release version of GlosSI can be found here, for example.

In the next version of the extension I have added the new settings to DefaultTarget.json and updated some default ones, but I'm a bit unsure about how I should do with already existing file (from before one updated the extension). Should I overwrite the old DefaultTarget.json file, and possible mess with someone's preferred settings? Or should I leave it be? I think I'll simply overwrite it and add a warning to the update notes.

Still, changes will not be applied retroactively to one's shortcuts, unless you remove and re-add every single shortcut. Either way, I'll have to add a feature to update the GlosSI shortcut files when releasing the new version, since I have changed them to support launching the shortcuts from Steam as well.

I should possibly also make some of the common DefaultTarget.json options editable in the UI, instead of via opening the file...

Oh, and do you think that the GlosSI overlay should be disabled or enabled by default (from the option to disable the GlosSI overlay without disabling the Steam overlay)?

@OdinIsLord
Copy link
Author

OdinIsLord commented Aug 16, 2023

@LemmusLemmus Any ETA on the update?

I tried adding the line which is "disableGlosSIOverlay": true, but it doesn't seem to work? newly created shortcut loads with the GlosSI overlay enabeld. and in GlosSiConfig the option to disable the GlosSi overlay isn't enabled although I have it enabled in the global settings. I don't get it. I'm still to use this extension as a daily driver as I can't manually disable the option for the XXXX games that I have in my library.

Personally I think the reasons people use the extension is for the Xinput, Big Picture mode so you can chat with your friends while playing non steam games and use the other features with the controller from your bed, and also for the game activity status. The GlosSi overlay is completely unnecessary and should be optional, not enabled by default.

And of course in addition to porting DefaultTarget.json options to the UI, having the option to update integration settings by mass selection in the library would be great too.

@LemmusLemmus
Copy link
Owner

LemmusLemmus commented Aug 16, 2023

Any ETA on the update?

I cannot make any promises, but I suspect I will have a pre-/experimental release available by the end of the week.

I tried adding the line which is "disableGlosSIOverlay": true, but it doesn't seem to work?

Did you add "disableGlosSIOverlay": true, inside the "window": { block?

I also noticed that the splash screen is still shown when the GlosSI overlay is disabled. I guess I could hide it by hiding the entire window for 3 seconds (although that also hides the Steam overlay for those 3 seconds), but an option to hide it should probably be added as an option in GlosSI instead.

The GlosSi overlay is completely unnecessary and should be optional, not enabled by default.

👍

having the option to update integration settings by mass selection in the library would be great too.

I think I will add a third right-click option to Playnite to Refresh/Update/Validate the selected shortcuts. A single button to update every shortcut could also be added in the settings menu. This could also validate that the shortcut is actually added to Steam.

@OdinIsLord
Copy link
Author

Did you add "disableGlosSIOverlay": true, inside the "window": { block?

Yes I did. But now I got it working, it seems like you need to set the option "disableOverlay" to "null", else the "disableGlosSIOverlay" option gets ignored. Now all shortcuts are created with only the steam overlay running.

With this and "closeOnExit" set to true which closes games on exit from BPM, I'm now able to use the extension to the fullest.

Thank you for taking the time and looking into the issue but you can close it now. Also looking forward to your next update.

@OdinIsLord
Copy link
Author

Okay, the closing option has been very inconsistent since I last commented, even with the same game. I'll sit it out until your update hopefully by the end of the week.

@LemmusLemmus
Copy link
Owner

@OdinIsLord I am terribly sorry for the delay, here is an experimental new version: GlosSIIntegration 1.1.2+ experimental1.zip. Simply drag the file and drop it into the Playnite window.
Please let me know if when you find any bugs, and if there is anything you would like to see changed or improved.

@OdinIsLord
Copy link
Author

@LemmusLemmus My goodness, I'm so sorry I must've missed your tag notification. I was checking every now and then to see if there was any update for like 2 weeks or so seeing the 2022 version being the latest, I ultimately gave up on it and stopped using the extension, thinking you abandoned the project. I just happened to scroll past my comment history and found your reply now, again very sorry about this.

Anyways, I just reinstalled the extension with your given link and I got an error whenever I try to create a steam or playnite overlay in the settings.

Playnite DesktopApp_fml9l5amyA

@LemmusLemmus
Copy link
Owner

What timing! I just fixed that bug today :). Use the version of the extension I uploaded in issue #29.

Well, it has not been abandoned, but I have certainly been very inactive. Sorry :(

@LemmusLemmus
Copy link
Owner

LemmusLemmus commented Dec 28, 2023

If you find the version stable enough, I will actually release it as an update! I should have done that ages ago... So please let me know if everything works OK.

The reason I have been hesitant to release it as an update is simply because I have rewritten pretty much everything concerning overlay switching, so, well, everything could go wrong :).

@OdinIsLord
Copy link
Author

So I've been testing it for the past hour and first of all, the feature that automatically copies Playnite artwork to Steam is a huge update, very much needed. You just need to have it fill the artwork for the game covers (cd grid) instead of having it zoomed in and uniformed.

Now when you remove an Integration, it also deletes the shortcut from steam which is great, launching game from steam shortcut now also works. All great additions and working flawlessly.

However, closing the game via Big Picture Mode, just like before, is a hit or miss and very inconsistent. Idk if it's my settings, if it's working consistently for you, then maybe you could share your defaultTarget.json and your standalone GlosSi settings too.

@LemmusLemmus
Copy link
Owner

LemmusLemmus commented Dec 29, 2023

Regarding the artwork, I assume that the cover/grid image you use in Playnite is not exactly 600x900? Currently, the extension simply creates a hard link (if possible, as to avoid unnecessary storage usage) to your Playnite images. This is of course not ideal, since the resolution of the images in Playnite will not always match the resolution Steam expects. Additionally, Playnite does not have all the images a game in Steam uses: Steam has a cover/grid, hero (for which the extension simply uses the background image), icon and logo (for which the extension uses the logo from the Extra Metadata Loader extension if you use it). Steam also uses a header image (the horizontal grid) for each game, for which there is no corresponding Playnite image. So the approach of using the Playnite images is inherently flawed/limited. The user could either use an external tool such as SGDBoop, or the extension could be extended to, for example, use the SteamGridDB API for retrieving appropriate Steam assets (maybe based on the SteamGridDBMetadata extension).

Regarding the closing of the game via Big Picture Mode, I see two situations it might not work in:

  1. If the game simply refuses to close. The extension gets a PID from Playnite, which it then force closes. This might fail if the PID is incorrect (for example, if the game has a built-in launcher or initial process unrelated to the game). However, Playnite game tracking would normally struggle in this situation, so I do not find this likely. You can check if this is the case by looking at the extensions.log file and seeing if Killed game in retaliation for GlosSI being killed. fires. Or, you can simply check if it works with any other game with a different launcher.
  2. Are you currently launching the game shortcut from Steam? I just checked, and the extension does not close the game if the game shortcut was started from Steam and the extension is "disabled" in Playnite (see image).
    image
    This should probably be fixed, but for now the simple solution is to, in the settings, ensure that the integration is enabled by default.

Other than that, it works well on my computer. I doubt the GlosSI settings are very important. If you want to, please share the relevant part of the extensions.log and playnite.log, as well as the GlosSI target .json file for a shortcut for which this problem occurs.

@OdinIsLord
Copy link
Author

For the artwork, I don't mind doubling my storage size for it as long as BPM looks pretty and clean.

I always launch my games from Playnite, and I have the extension enabled as you can see on the top right:

Playnite DesktopApp_VwCQPpkBS2

Extension settings:

Playnite DesktopApp_NwtECGJnCn

DefaultTraget.json file:

Code_B7JFdTYCrD

Standalone GlosSi program default settings:

GlosSIConfig_aY52WJxaIB

What the shortcut settings look like after creating an integration for a game from the Playnite extension:

GlosSIConfig_SFlMQWw8OO

For the log, I have removed all integrations, deleted the log file content of both extensions.log and playnite.log and started from scratch and tested a couple standalone games, a few emulators (RetroArch, Duckstation, PCSX2, RPCS3) with different game titles. For easy visibility.

playnite.log
extensions.log

So what games did close?

God Of War. (Standalone)
Tekken. (DuckStation)
Naruto, Soul Reaver 2. (PCSX2)
God of War HD. (RPCS3)
Cadillacs and Dinosaurs. (RetroArch)

What games did not close initially but closed after relaunching the game and trying again one or more times?

God of War: Ascension. (RPCS3)
Prince Of Persia. (RetroArch)

What Games did not close no matter how many times I tried?

The Last of Us Part I: Digital Deluxe Edition. (Standalone)

Notable observation, more often than not, I have to click the guide button a second time for steam BPM to focus. clicking only once would only play the sound in the background.

Hope this helps.

@LemmusLemmus
Copy link
Owner

LemmusLemmus commented Dec 31, 2023

I have been able to reproduce the issue! (or at least, a issue. There might be other problems as well.) For example, if I start the game in the task manager screenshot below, there are two separate processes that are started for the game.
image

Playnite (or rather, the "official" Epic Games library extension) does not tell them apart, and will randomly return to the extension either the process ID of the game, or the process ID of the (in this case) Unity crashhandler. This is fine for Playnite, since it only tracks when the process closes (and if the game closes, the crashhandler will also close). However, the GlosSI Integration extension needs the process ID of the game specifically. The game does not close if the extension kills the crashhandler.

So, the extension will somehow have to figure out which process(es) to kill, based on the PID of one of the processes involved with the game. I have couple of ideas, but none are foolproof. I will see what can be done.

Is it the case for The Last of Us Part I: Digital Deluxe Edition, that it starts with multiple processes (you might be able to see it in the task manager, as in the screenshot above), or that the initial process started is not the game?

@OdinIsLord
Copy link
Author

Yes there are multiple processes when I start The Last of Us Part I: Digital Deluxe Edition:

Taskmgr_dbQL0aEj4B

And also God of War: Ascension:

Taskmgr_bdoIjmKWpe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
2 participants