Maintain configurable cache location and size for recently extracted game archives

Issue #752 closed
fraganator created an issue

The "Extract ROM archives before running" feature could be enhanced to utilise a "recently played" cache of games. This would improve usability for frequently played games.

A configurable cache location and size limit (say 10GB) would be set, and when a game is first extracted from an archive, it is placed in the cache location. Subsequent launches of the game would first check the cache for the decompressed game. If it exists, no decompression is needed and the game is launched immediately. If the game doesn't exist in the cache, it is decompressed to the cache and then launched.

As the cache size approaches the size limit, older titles are removed from the cache to make room. If a single game exceeds the cache size, the entire cache would be deleted and the single game placed in there.

There could be a single game cache, or a cache per emulator. I'd prefer a single cache to simplify disk management.

This enhancement is similar to #605, though I think this would be more functional with the added automatic cache size management.

Edit: Idea has been implemented as a LaunchBox plugin: https://forums.launchbox-app.com/files/file/234-archive-cache-manager/

Comments (11)

  1. Brad Cheyne

    Why archive games then? Why not just leave the games you play a lot as their regular files or why bother archiving in the first place then? The point is to save space, but now you have some games that are doubled up just potentially on two different drives? We still don't suggest to archive games for the performance reasons you outlined, but then the older consoles you aren't saving much so... I am just curious.

  2. fraganator reporter

    Thanks for the response Brad. You've made me think about it a bit more, and I still think it's a valid and useful idea.

    The primary use case for the cache is to avoid decompression times for an active/recent set of games being played. For example I've got several PlayStation 2 games I'm working my way through. As each game is completed, I'll move onto another game. There is no single set of games I play a lot, at least not enough to justify having some games in archives, and some not.

    Having several PS2 (or PSX / Dreamcast / Gamecube / other disc based console) games uncompressed in a cache ready to go, while the whole collection of several hundred games remains archived is a significant space saving (hundreds of gigabytes, if not terabytes for complete disc based game sets).

    The cache doesn't provide any real advantage for older consoles (16-bit and older), but then older console emulators already support archives directly. I've only enabled the "Extract ROM archives before running" flag for disc based consoles, so older console game archives wouldn't even go into the cache.

    I don't view the games as being doubled up. There's a single source of games - what's in your collection. The cache only serves to skip decompression for the most recently played games.

    Perhaps the cache size isn't defined in terms of bytes, but of number of recently played games?

  3. Brad Cheyne

    That's what I mean though, if you want a cache for frequent games why not just leave the games decompressed for the time being? It is the data twice, the archive then the decompressed cache. Yes the offset is obviously a lot more savings as a whole, but still. Also have you looked in to CSO, WBFS and GCM compressions for PS2 / PSP, Wii and GameCube respectively? Here is a topic I started about CSO's for PS2 games. https://www.launchbox-app.com/forum/emulation/ps2-compressed-all-my-games-as-csos-378-games-669gb

    The savings aren't as great as ultra compression with winrar or 7zip, but it's comparable and there is no decompression method.

    I also don't say this to invalidate this ticket, this is still a very good idea in the long run because people will do what they want regardless of our recommendations, but I do like to offer alternatives as well.

  4. Ron Barker

    I see what Brad is saying Frag.

    Even if you have your PS2 set up to extract before playing, if you go to open a game that isn't compressed, it will still launch. So just keep an iso copy of that particular game in your game folder, while leaving the other 8723 in 7zip.

    It's basically the same thing, except that you know what game you're playing and working on steadily, instead of LB having to look for it before launching every game.

  5. Former user Account Deleted

    This is a great idea! I have like 200 PlayStation games in t7z format. I don't play all of them all the time, so having a cache of the last played games would be great. The process of choosing which games you want to play frequently, extract them, add them to LaunchBox, becomes a pain when you have everything set up in your living room with your big TV and all you want to do is pick a controller and play games from your library.

  6. fraganator reporter

    I've written a little application which handles this caching mechanism, and is transparent to LaunchBox (as of I think version 5.9, I haven't tested the latest builds). It has worked well for me running compressed PS1 and PS2 games, automatically decompressing them or loading them directly from the cache with minimal wait time. If you're interested I can give you a download link.

  7. Log in to comment