04-05-2020, 09:53 AM
(This post was last modified: 10-14-2020, 02:51 PM by darklinkpower.)
PlayState | Extension to suspend/resume games at any moment. Pause whenever you want.
Description
This extension will let you suspend and resume your game at any moment. This gives a the benefit of pausing your game at any time and also to free your CPU and GPU usage when you are not playing, effectively acting as if you closed the game when you activate the script. See the screenshots for comparison.
Github Repository: https://github.com/darklinkpower/Playnit...Extensions
Installation/Requirements
1. First download AutoHotKey here and install it: https://www.autohotkey.com
Attention: You might get a message by google or your browser that AutoHotKey's website is malicious. AutoHotKey has got false positives by antivirus and it's possible this caused Google to say that the site is malicious but this is not true. I suggest you read AutoHotKey's team explanation of the matter here: https://autohotkey.com/download/safe.htm
2. Download the latest "PlayState*.pext" extension file from the Download section and drag and drop it to the Playnite main window to install.
Usage
PlayState:
1. Launch your game.
2. Press either the 'Home' or 'Pause' key to suspend/resume your game. If you are running your game in exclusive fullscreen it is highly recommended to alt+tab first before using the functions to prevent issues.
PlayState blacklist system:
The blacklist system is designed for games you don't want the extension to be executed for.
1. Select the games you want to add or remove from the blacklist in the Playnite UI
2. Select in the extension submenu
Screenshots
![[Image: 2020-04-18_16-03-56.gif]](https://s4.gifyu.com/images/2020-04-18_16-03-56.gif)
Before Suspend (15.1% CPU and 62.7% GPU usage):
![[Image: 8tppCJ7.jpg]](https://i.imgur.com/8tppCJ7.jpg)
After Suspend (0.0% CPU and 0.0% GPU usage):
![[Image: lWpVxIW.jpg]](https://i.imgur.com/lWpVxIW.jpg)
Blacklist system functions:
![[Image: BPwTGPx.png]](https://i.imgur.com/BPwTGPx.png)
Troubleshooting (Extension not working with game)
1. Check that you have not added the game to the blacklist in the PlayState by seeing if the game has a Feature with the name "PlayState blacklist". If that's the case, remove it from the blacklist with the extension menu function or with Playnite.
![[Image: Y3mIlRY.png]](https://i.imgur.com/Y3mIlRY.png)
2. Make sure you have installed AutoHotKey in any location and that you have the "AutoHotkeyU64.exe" executable inside the installation directory, since it's the executable PlayState uses for the suspend function.
![[Image: lULeamT.png]](https://i.imgur.com/lULeamT.png)
3. If you see the PlayState script running in your tray and it's not working, click on "Edit This Script"
![[Image: epWgBT5.png]](https://i.imgur.com/epWgBT5.png)
Check if the highlighted parts have the same name as your game executable (You can check which is the game executable by opening the task manager, right clicking on your game process and selecting "Open file location". It should take you to the folder and highlight the game executable that is running).
![[Image: qPHNYjq.png]](https://i.imgur.com/qPHNYjq.png)
PlayState detection couples multiple detection methods to grab the correct executable with an internal database exclusion list. It might be possible that this may cause that the wrong executable is picked in extremely rare cases. If that happens, please send me the PlayState.log (located at {PlayniteDir}\PlayState.log) via discord or copy and send information from that runtime here and tell me what should have been the correct executable. For example, I would need something like this:
![[Image: R4hQ1xS.png]](https://i.imgur.com/R4hQ1xS.png)
4. If your game is launched with administrator rights, you'll need to configurate the AutoHotkeyU64.exe to launch with administrator rights too by going into it's properties.
FAQ
Q: "Does it stop playtime tracking by Playnite while the game is suspended?"
A: No, Playtime tracking is handled by Playnite and it's library plugins. Since the process isn't closed, it still gets detected as opened and playtime tracking will continue.
Q: "Does it work with Microsoft Store/Xbox/Game Pass games?"
A: Yes, no limitations apply for games from any source.
Q: "Is there any limitation or games that are not compatible?"
A: All games are compatible from all my tests. There shouldn't be incompatible games since version 1.3 but if you find one let me know.
Q: "Will this ban me in online games?"
A: I'm not sure but I don't recommend using it in online games just for safety. Also in an online game the server will timeout and kick you after a few seconds if you suspend your game.
Q: "Why did I get an "App not responding" Windows message?"
A: That must be because you are trying to interact with the game after suspending it but it has not been resumed. Windows says that message because it in fact doesn't respond because the game is still suspended. To prevent this, if you are running your game in exclusive fullscreen mode make sure to first alt+tab before using the suspend function and seen the "Game Suspended" message and then resume the game and make sure the "Game Resumed" message shows before alt+tabbing to the game again.
Changelog
v1.0
v1.1
v1.3
v1.4
v1.5
v1.5.1
v1.6
v1.6.1
v1.7
v1.7.1
Download:
PlayState_1_7_1.pext (Size: 15.78 KB / Downloads: 182)
Description
This extension will let you suspend and resume your game at any moment. This gives a the benefit of pausing your game at any time and also to free your CPU and GPU usage when you are not playing, effectively acting as if you closed the game when you activate the script. See the screenshots for comparison.
Github Repository: https://github.com/darklinkpower/Playnit...Extensions
Installation/Requirements
1. First download AutoHotKey here and install it: https://www.autohotkey.com
Attention: You might get a message by google or your browser that AutoHotKey's website is malicious. AutoHotKey has got false positives by antivirus and it's possible this caused Google to say that the site is malicious but this is not true. I suggest you read AutoHotKey's team explanation of the matter here: https://autohotkey.com/download/safe.htm
2. Download the latest "PlayState*.pext" extension file from the Download section and drag and drop it to the Playnite main window to install.
Usage
PlayState:
1. Launch your game.
2. Press either the 'Home' or 'Pause' key to suspend/resume your game. If you are running your game in exclusive fullscreen it is highly recommended to alt+tab first before using the functions to prevent issues.
PlayState blacklist system:
The blacklist system is designed for games you don't want the extension to be executed for.
1. Select the games you want to add or remove from the blacklist in the Playnite UI
2. Select in the extension submenu
- "PlayState - Add selected games to blacklist" for games you want to add to the blacklist
- "PlayState - Remove selected games from blacklist" for games you want to remove from the blacklist
Screenshots
![[Image: 2020-04-18_16-03-56.gif]](https://s4.gifyu.com/images/2020-04-18_16-03-56.gif)
Before Suspend (15.1% CPU and 62.7% GPU usage):
![[Image: 8tppCJ7.jpg]](https://i.imgur.com/8tppCJ7.jpg)
After Suspend (0.0% CPU and 0.0% GPU usage):
![[Image: lWpVxIW.jpg]](https://i.imgur.com/lWpVxIW.jpg)
Blacklist system functions:
![[Image: BPwTGPx.png]](https://i.imgur.com/BPwTGPx.png)
Troubleshooting (Extension not working with game)
1. Check that you have not added the game to the blacklist in the PlayState by seeing if the game has a Feature with the name "PlayState blacklist". If that's the case, remove it from the blacklist with the extension menu function or with Playnite.
![[Image: Y3mIlRY.png]](https://i.imgur.com/Y3mIlRY.png)
2. Make sure you have installed AutoHotKey in any location and that you have the "AutoHotkeyU64.exe" executable inside the installation directory, since it's the executable PlayState uses for the suspend function.
![[Image: lULeamT.png]](https://i.imgur.com/lULeamT.png)
3. If you see the PlayState script running in your tray and it's not working, click on "Edit This Script"
![[Image: epWgBT5.png]](https://i.imgur.com/epWgBT5.png)
Check if the highlighted parts have the same name as your game executable (You can check which is the game executable by opening the task manager, right clicking on your game process and selecting "Open file location". It should take you to the folder and highlight the game executable that is running).
![[Image: qPHNYjq.png]](https://i.imgur.com/qPHNYjq.png)
PlayState detection couples multiple detection methods to grab the correct executable with an internal database exclusion list. It might be possible that this may cause that the wrong executable is picked in extremely rare cases. If that happens, please send me the PlayState.log (located at {PlayniteDir}\PlayState.log) via discord or copy and send information from that runtime here and tell me what should have been the correct executable. For example, I would need something like this:
![[Image: R4hQ1xS.png]](https://i.imgur.com/R4hQ1xS.png)
4. If your game is launched with administrator rights, you'll need to configurate the AutoHotkeyU64.exe to launch with administrator rights too by going into it's properties.
FAQ
Q: "Does it stop playtime tracking by Playnite while the game is suspended?"
A: No, Playtime tracking is handled by Playnite and it's library plugins. Since the process isn't closed, it still gets detected as opened and playtime tracking will continue.
Q: "Does it work with Microsoft Store/Xbox/Game Pass games?"
A: Yes, no limitations apply for games from any source.
Q: "Is there any limitation or games that are not compatible?"
A: All games are compatible from all my tests. There shouldn't be incompatible games since version 1.3 but if you find one let me know.
Q: "Will this ban me in online games?"
A: I'm not sure but I don't recommend using it in online games just for safety. Also in an online game the server will timeout and kick you after a few seconds if you suspend your game.
Q: "Why did I get an "App not responding" Windows message?"
A: That must be because you are trying to interact with the game after suspending it but it has not been resumed. Windows says that message because it in fact doesn't respond because the game is still suspended. To prevent this, if you are running your game in exclusive fullscreen mode make sure to first alt+tab before using the suspend function and seen the "Game Suspended" message and then resume the game and make sure the "Game Resumed" message shows before alt+tabbing to the game again.
Changelog
v1.0
- Initial Release
v1.1
- Added extension icon
- Improved detection of specific games (Dark Souls III, Dragon Quest XI, The Witcher2, etc.)
- Improved detection of Unreal Engine games
- General game detection improvements
- Code improvements and cleanup
v1.3
- Rewrote detection functions from scratch. Detection accuracy should be 99~%
- Fixed incompatibility with 64 bits games in previous versions
- Added logging to extension. Log is generated at {PlayniteDir}\PlayState.log
- Added automatic AutoHotKey installation directory detection via registry key. It's no longer neccesary to install at default location
- Added PlayState internal exclusion list for executables to be ignored during initial executable game detection (For launchers, configuration executables, etc)
- Code optimization and cleanup
v1.4
- Changed activation key. Suspend and resume functions now activate with either the 'Home' or 'Pause' key.
- Added 10 seconds delay to detect functions to prevent bootstrap or launcher executables not filtered from getting picked.
- Added game name to suspend/resume message window.
- Added extra logging.
- Fix: Removed "DarkSoulsIII.exe" from exclusion list that was added for testing.
v1.5
- Made changes to how the extension works to prevent Playnite from locking when the extension is still working
- Increased delay to detect functions from 10 to 40 seconds to further prevent bootstrap or launcher executables not filtered from getting picked.
- Increased detect executable runtimes to 60 seconds.
- Fixed logs not including seconds.
- Removed old unused detection methods that are no longer needed.
v1.5.1
- Correctly close Autohotkey executable on game exit in cases where it has been set to run as administrator.
- Prevent executable search functions from running if game platform is not PC.
v1.6
- Implemented blacklist system for games you don't want the extension to be executed for.
v1.6.1
- Use game features field for PlayState blacklist system.
v1.7
- Refactor and cleanup
- Support for emulated games
- Fix in cases where previous AutoHotKey executable was not closed correctly
v1.7.1
- Reorganized extension functions in submenu.
- Added Id property and Github link to extension manifest.
- Fix log not being deleted when size exceeds set size
- Add "Texmod.exe" to exclusion list
Download: