Open sonic2kk opened 8 months ago
Another potentially related bit to this: Steam stores user-collections
information for removed Steam shortcuts in localconfig.vdf
. When these shortcuts are removed Steam still keeps them in localconfig.vdf
. I think this information may also be pulled from a LevelDB so it may also/actually need to be removed from there in the first place.
Steam does now seem to remove compatdata folders for Non-Steam Games but I'm not sure if the other parts of this issue are solved.
Steam will remove Non-Steam Game compatdatas as noted above, as well as their CompatToolMapping
s from config.vdf
. However it is still missing the following:
localconfig.vdf
don't get cleaned up. This includes (but may not be limited to) games in user-collections
put into the "Hidden" category (they are still in the hidden
array, using the unsigned 32bit AppID), and games in the "Apps" section that maps a game's OverlayAppEnable
and DisableLaunchInVR
settings (using the signed 32bit AppID).
Your system information
Please describe your issue in as much detail as possible:
When adding a Non-Steam Game, Steam will generate a seemingly random AppID, adding the same game with the same information will always produce a different AppID. This part is fine. The problem is that Steam leaves behind some information and files in this process. Some examples:
Non-Steam Game Grids
Non-Steam Game grids are not removed. Steam sets grids in
~/.local/share/Steam/userdata/<id>/config/grid
, and the names are associated with the game's AppID. For Non-Steam Games, this might be240315734_hero.jpg
. But when the Non-Steam Game is removed, Steam won't remove this artwork. If someone is using animated library artwork, this could get really large really fast, as some animated assets can exceed double-digit megabytes. And since the artwork cannot be re-used again for that game as the AppID is random, these files are entirely unused. There is a case where the same AppID could be generated for the same game or an unrelated game.Some utility software, like Steam-ROM-Manager and SteamTinkerLaunch, generate consistent AppIDs by writing a deterministic AppID for the shortcut entry into
shortcuts.vdf
, so in those cases the artwork can be re-used, but I still think it makes more sense for Steam to remove these stray files.A user can perform this step manually, but I'm not sure how many users would think to remove the artwork first.
Non-Steam Proton Prefixes
Non-Steam Proton prefixes are not removed. When running a Non-Steam Game with Proton, as far as I can tell it always creates a compatdata at
~/.local/share/Steam/steamapps/compatdata/<nonsteam-appid>
. This could also just be the compatdata in the default library folder that a user selected, but I didn't check and my default library folder is the one on my boot drive, so the Non-Steam compatdata folders are created there.Steam doesn't remove the compatdata when regular Steam games are refunded, removed from account, or uninstalled. In the case of uninstalled games that does make sense, a user may choose to reinstall the game and they would want to keep their save data. But for Non-Steam Games, again because the AppID is different each time the game is added, the prefix can never be re-used, so it is effectively ~300mb lost for each Non-Steam Game ran via Proton.
This one may be better as a setting somewhere, since utility software can set a deterministic AppID for Non-Steam Games and in thoose cases the prefix can be re-used, but it would also be fair enough to ignore those tools and expect users to manage and back up their Non-Steam compatdata folders.
This is also the only part of this feature request that is specific to Steam for Linux :-)
CompatToolMapping Entries Stay in
config.vdf
This one is less severe. Steam has a file called
config.vdf
(text VDF, not a binary VDF file likeappinfo.vdf
orshortcuts.vdf
) which stores a lot of information, including a block calledCompatToolMapping
. This section stores information about which games (by AppID) are using which compatibility tools. The name of the compatibility tool is based on the internal name of the tool as defined in itscompatibilitytools.vdf
file. The first entry,"0"
, is the default global compatibility tool.Non-Steam Games are also added to this file, their entries using the unsigned integer AppID. When a shortcut is removed from Steam, this entry is not removed with it. This has two implications:
config.vdf
, it may either add a new mapping which could conflict/get discarded/is just all around not a great idea, or it may ignore an existing entry and not set a compatibility tool.It seems better to me overall that, if Steam is going to generate a random AppID, it should discard, it should discard any information hinging on this AppID as it is effectively unusable once the game is removed.
This issue only covers games being removed directly from Steam and not when
shortcuts.vdf
is modified directly or removed. In those cases, I don't think it's possible for Steam to know that Non-Steam Games were removed, though forconfig.vdf
it may be feasible to check if there are entries for AppIDs that are no longer in the library. The same could possibly be said for grids and compatdata. But in those cases, Steam has a higher chance of removing something unintentionally, so I can understand the perspective of simply doing nothing in cases whereshortcuts.vdf
is modified. But when using the client directly, I think it makes sense to do this sort of cleanup.There may be more examples, but these are just the ones I have encountered :-) And to be clear, I don't think any of these are "bugs", hence why I have labelled this as a feature request.
Thanks!
Steps for reproducing this issue:
Non-Steam Game Grids:
Non-Steam Game Prefixes:
~/.local/share/Steam/steamapps/compatdata
Non-Steam Game
config.vdf
Entries~/.local/share/Steam/config/
and openconfig.vdf
CompatToolMapping
block, and at the bottom there should be an entry for the Non-Steam Game (this AppID is always 9 digits, making it stand out, and the newest entry is always appended to the bottom of thisCompatToolMapping
)config.vdf
, the mapping for this AppID inCompatToolMapping
is not removed.config.vdf
Restarting Steam does not affect the behaviour of any of these three cases.