Jump to content
LaunchBox Community Forums

Recommended Posts

Archive Cache Manager

View File

Achive Cache Manager logo

A LaunchBox plugin which caches extracted ROM archives, letting you play games faster. Also allows launching individual files from archives, and loading preferred file type from an archive.

Description

When a compressed ROM (in zip, 7z, or other compression format) is first extracted, it is stored in the archive cache. The next time it is played, the data is loaded directly from the cache, virtually eliminating wait time.

Launch time comparison video

As the cache approaches its maximum size, the least recently played games are deleted from the cache, making room for new games.

Features

  • NEW FEATURE - Keep select ROMs cached and ready to play.
    • Games marked 'Keep' won't be automatically cleaned from the cache.
    • Useful for less frequently played games which you still want to load without waiting (party games, favourites, children's games, etc)
  • NEW FEATURE - Select and play individual ROM files from an archive!
    • Useful for GoodMerged sets, or archives with mixed ROMs and cue sheets (MSU).
  • Skip the extraction wait time for recently played games.
  • Configurable cache size and location.
  • Configurable minimum archive size (skip caching small archives).
  • File extension priorities per emulator and platform (cue, bin, iso, etc).

Example Usage

Why use Archive Cache Manager? Here's some example use cases.

  • Zipped ROMs located on network server or cloud drive, where disk read or network transfer time is slow.
  • ROM library maintained as accurately ripped/dumped collections, where specialised compression formats not an option.
  • Extract and play archives from location other than LaunchBox\ThirdParty\7-Zip\Temp, such as high speed SSD.
  • Playing ripped PS2 games with PCSX2 where the disc image is bin/cue format, avoiding the "CDVD plugin failed to open" error message.
  • Your library contains GoodMerged sets, and you want a quick way to play individual ROMs.

Installation

Uninstallation

  • Quit LaunchBox / BigBox, then navigate to the LaunchBox\Plugins folder and delete ArchiveCacheManager.
  • Delete the archive cache folder (default is LaunchBox\ArchiveCache).

Usage

Archive Cache Manager is designed to run transparent to the user. All that is required is the emulator has the "Extract ROM archives before running" option checked. Extraction and cache management is carried out automatically when a game is launched.

Selecting and Playing Individual ROMs From an Archive

To play an individual ROM from an archive containing multiple ROMs (different regions, hacks, or discs), right-click it and choose "Select ROM In Archive...".

A window will popup with a full listing of the archive contents. Select the desired ROM file, then click Play. That ROM will now launch with the configured emulator.

ROM file selection window

Keeping Games Cached

Games can be marked 'Keep' so they stay cached and ready to play. To keep a game cached, open the plugin configuration window from the Tools->Archive Cache Manager menu. From there a list of games in the cache is shown. Check the Keep box next to the game, then click OK.

Configuration

Configuration can be accessed from the Tools->Archive Cache Manager menu.

Achive Cache Manager config screen

An overview of each of the configuration items is below.

Cache Details

This section shows a summary of the cache including the Cache Path, Cache Size, and Keep Size. It also displays a list of the items currently in the cache.

Cached Items & Keep

Each item in the cache has a Keep flag, which when set will prevent the item from being removed from the cache when the cache is full. This is useful for less frequently played games which you still want to load without waiting (party games, favourites, children's games, etc).

Items marked Keep are not included in the cache size calculation. The total size of Keep items is listed in the cache details summary.

Configure Cache

Clicking the Configure Cache... button opens the cache configuration window.

Achive Cache Manager cache config screen

Configure Cache - Cache Path

This is the path of the cache on disk. The path can be absolute or relative, where relative paths are to the LaunchBox root folder.

Default: ArchiveCache

If the cache path is set to an invalid location (LaunchBox root for example), an error message will be displayed when clicking OK.

Cache path error

If the cache path is set to an existing path that already contains files or folders, a warning will be displayed when clicking OK. Click Yes to proceed, or No to go back and change the path.

Cache path warning

Configure Cache - Cache Size

This is the maximum cache size on disk in megabytes. The oldest played games will be deleted from the cache when it reaches this size.

Default: 20,000 MB (20 GB)

Configure Cache - Minimum Archive Size

This is the minimum size in megabytes of an uncompressed archive to be added to the cache. Archives smaller than this won't be added to the cache.

Default: 100 MB

Open In Explorer

Clicking the Open In Explorer button will open the configured cache path in Windows Explorer. This button is disabled if the cache path does not exist.

Refresh

Refreshes the cache summary and list of cached items from disk.

Delete

Clicking on the Delete button will remove the selected items from the cache (including items with the Keep setting).

Purge Cache

Clicking on the Delete All button will delete everything from the cache (including items with the Keep setting).

File Extension Priority

This defines the file extension priority for the specified emulator and platform combination. Use the Add / Edit / Delete buttons to manage file extension priorities.

File extensions are a comma delimited list, where the highest priority is the first extension, the next highest priority is the second extension, and so on. If the file extension is not found in the archive when a game is loaded, the default LaunchBox priority is used.

Note that the extension priority is applied to all archives, even if they are not cached.

Default: PCSX2 \ Sony Playstation 2 \ bin, iso

Source Code

Source available on GitHub, licensed under the LGPL: https://github.com/fraganator/archive-cache-manager

     
     
     

 


 

  • Thanks 2
Link to comment
Share on other sites

  • 10 months later...

Ok, so I just tried this extension and it's almost what I want it to be. I thought it would extract the compressed file to a certain location and then run it from there, but it does not quite do that. It does extract the rom to a certain cache location, but when running (again) it copies the file from the cache back to where Launchbox would originally extract the rom. Well, I just want to run it from the cache, no copying around :P

If I understand it correctly, it is possible by setting FileCopy to false, but then it's using NTFS features which isn't possible in my case because apparently (I never really bothered to check it) my external drive containing the games is exFAT. Is there any way to run the roms directly from the cache and skip the copy and NTFS links and such?

Other than that, nice work on the plugin. I like the loading screen; feels a bit more 'complete' than Launchbox' own 'is-it-crashing-or-is-it-loading-screen?' ;)

Edited by Landcross
Link to comment
Share on other sites

Hi Landcross,

Thanks for your comments. Your understanding is correct on the plugin usage. Unfortunately exFAT doesn't support directory junctions or hardlinks, In this case the plugin automatically falls back to a regular file copy when the cache or LaunchBox location is on a non-NTFS volume. I'll investigate if there are any options to avoid a copy for exFAT volumes.

On 20/11/2017 at 5:34 PM, Landcross said:

I like the loading screen; feels a bit more 'complete' than Launchbox' own 'is-it-crashing-or-is-it-loading-screen?' ;)

That was the main reason for adding it :)

  • Thanks 1
Link to comment
Share on other sites

4 hours ago, fraganator said:

Thanks for your comments. Your understanding is correct on the plugin usage. Unfortunately exFAT doesn't support directory junctions or hardlinks, In this case the plugin automatically falls back to a regular file copy when the cache or LaunchBox location is on a non-NTFS volume. I'll investigate if there are any options to avoid a copy for exFAT volumes.

Thanks for your reply ^_^

I don't know exactly how your plugin works underwater and how it (can) interact with Launchbox, but I was wondering: isn't it just possible to fire up the emulator with the rompath pointing directly to the cache instead of doing file-system 'tricks'? Or don't you have any control over that (which I think is very likely the case)?

Link to comment
Share on other sites

The plugin acts as a proxy between LaunchBox and 7-Zip, and bypasses the extraction process if the game already exists in the cache. It then creates a hardlink between the cached game and the temp folder, so LaunchBox thinks the game has been extracted to where it asked, and then launches the emulator.

After a bit of experimenting, I think I may be able to achieve exactly what you're asking (absolute rompath), without any file system tricks. I'll test a bit more and upload a new version soon (if it works!)

Edited by fraganator
Typo
  • Thanks 1
Link to comment
Share on other sites

On 22/11/2017 at 4:04 PM, Landcross said:

isn't it just possible to fire up the emulator with the rompath pointing directly to the cache instead of doing file-system 'tricks'?

I've just uploaded a new version which does just what you're asking. If you run into further issues, just let me know.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

6 hours ago, fraganator said:

I've just uploaded a new version which does just what you're asking. If you run into further issues, just let me know.

Well, I just did a quick test and it seems to work perfectly fine. That's some great work mate! Many, many thanks! :D:D

It's a shame your plugin isn't more popular, it's pretty darn cool.

  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...

I really like this plugin, it works really well. Thanks for making it, it's exactly what I needed!

 

I would like to know if there is possible to set FilePriority per Platform within the same Emulator.

For example: I use the same emulator (Retroarch) for both 3DO and TurboGrafxCD.
But I need different file priorities for each platform, ".iso" files for 3DO and ".cue" files for TGCD

I could achieve this using two different emulators within Launchbox: Retroarch (3DO), Retroarch (TGCD). But I much rather prefer to have every platform under one single emulator entry.

Link to comment
Share on other sites

New version is released which adds emulator + platform file priority. See the release notes for details, but it's just a matter of adding a <Platform> tag after the <Emulator> tag, such as:

<FilePriority>
  <Emulator>Retroarch</Emulator>
  <Platform>3DO Interactive Multiplayer</Platform>
  <Extensions>iso</Extensions>
</FilePriority>
<FilePriority>
  <Emulator>Retroarch</Emulator>
  <Platform>NEC TurboGrafx-CD</Platform>
  <Extensions>cue</Extensions>
</FilePriority>

Note that the <Platform> tag isn't required. If it's not present, the priority will apply to all platforms for that emulator. Let me know if there are any issues :)

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

@fraganator Thank you so much for implementing that option. :D I haven't had any issues with it, it works perfectly! 

 

Since this plugin acts as an intermediary between Launchbox and 7zip.... would it be possible to select manually which file to launch?

That would be really useful for users that have complete merged romsets. 

e.g. when you launch the following 7z file:

Spoiler

Legend of Zelda, The - Ocarina of Time (Europe) (En,Fr,De) (Rev A).n64
Legend of Zelda, The - Ocarina of Time (Europe) (En,Fr,De).n64
Legend of Zelda, The - Ocarina of Time (Europe) (GameCube Edition).n64
Legend of Zelda, The - Ocarina of Time (USA) (GameCube Edition).n64
Legend of Zelda, The - Ocarina of Time (USA) (Rev A).n64
Legend of Zelda, The - Ocarina of Time (USA) (Rev B).n64
Legend of Zelda, The - Ocarina of Time (USA).n64
Zelda no Densetsu - Toki no Ocarina (Japan) (Rev A).n64
Zelda no Densetsu - Toki no Ocarina (Japan) (Rev B).n64
Zelda no Densetsu - Toki no Ocarina (Japan).n64
Zelda no Densetsu - Toki no Ocarina GC (Japan) (GameCube Edition).n64

A list prompt appears which gives you the option to select which rom to launch.

With the lastest updates, Launchbox has implemented something similar with "additional applications", but the scrapper still presents problems associating roms with different regional names, making the process of building a big library extremely tedious. Also you loose the benefits of having your entire collection compressed, which saves a lot of space with big sets.

I hope something like this could be achieved, this would be extremely useful for those that already have entire no-intro merged sets.

Edited by NahuelDS
  • Thanks 1
Link to comment
Share on other sites

@NahuelDS Not a problem, thanks for letting me know :)

A file picker when launching a merged rom set would be useful. I'm not sure if it's beyond the scope of what this plugin is designed for, but technically it can be done. I'll have a think about whether adding to this plugin makes sense, or if it's better handled some other way. Don't hold your breath though! :P

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...

The plugin doesn't seem to work with the new Launchbox.Next. When I try to start Launchbox.Next, I get the following message:

Quote

Archive Cache Manager can only be started via LaunchBox / BigBox.

Ensure the folder "LaunchBox\ArchiveCacheManager" exists, and the emulator's "Extract ROM archives before running" option is checked.

And after pressing OK nothing happens. After uninstalling Archive Cache Manager, Launchbox.next does run.

Now, I don't mind it; Launchbox.next is beta and still very new, but figured I'd report it here anyway :)

  • Thanks 1
Link to comment
Share on other sites

Thanks for the heads-up! I was out of the loop with the LB betas, but this .Next version looks nice.

The archive manager plugin currently checks the calling program is either LaunchBox or BigBox, so the error you're seeing is expected. It'll be easy enough to add a check for LaunchBox.Next.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

On 19-3-2018 at 8:40 AM, fraganator said:

Thanks for the heads-up! I was out of the loop with the LB betas, but this .Next version looks nice.

The archive manager plugin currently checks the calling program is either LaunchBox or BigBox, so the error you're seeing is expected. It'll be easy enough to add a check for LaunchBox.Next.

Cool! :) I already expected it to be something like that. 

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...