Jump to content
LaunchBox Community Forums

Recommended Posts

Archive Cache Manager

View File

A tool which manages a cache of recently extracted game archives for quick loading. Also allows per emulator file extension priority for files within an archive.


Description
When an archived game (in zip, 7z, or other compression format) is extracted and played, it is stored in the archive cache. The next time the game is played, the data is loaded directly from the cache, eliminating the extraction wait time.

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


Features

  • Configurable cache size and location.
  • Configurable minimum archive size, so small archives aren't cached.
  • File extension priorities per emulator and platform (cue, bin, iso, etc).
    • Some combinations of emulators and file extensions don't work with LaunchBox's built-in priority.
  • Cache cleanup using either least recently played games or least played games.
  • Optional loading screen while an archive is being extracted.


Installation / Update

  • Extract the archive to your LaunchBox folder, which will create an ArchiveCacheManager sub-folder.
  • Navigate to the new ArchiveCacheManager folder and run Install.bat.
  • Within LaunchBox, ensure the desired emulator has the "Extract ROM archives before running option" checked.


Uninstallation

  • Navigate to the LaunchBox\ArchiveCacheManager folder and run Uninstall.bat.
  • Delete the ArchiveCacheManager folder.

NOTE: The archive cache is not removed on uninstallation, but can be manually deleted.


Configuration
The first time a game is extracted using Archive Cache Manager, a configuration file called Config.xml is created in LaunchBox\ArchiveCacheManager. Modify this file using Notepad or similar to make any configuration changes. An overview of each of the configuration items is below.

<MaxCacheSize>
This is the maximum size on disk (in megabytes) that the cache is allowed to grow to before cached items are deleted. The default is 20000MB, or 20GB.

<MinArchiveSize>
This is the minimum size (in megabytes) an uncompressed archive needs to be before it is added to the cache. The default is 50MB.

<CachePath>
This is the path of the cache folder. The path can be absolute or relative, where relative paths are to the LaunchBox\ArchiveCacheManager folder. The default is Cache.

<UsePlaycountWhenClearingCache>
Items can be removed from the cache based on the least recent playtime, or the least played games. Set this to True to delete the least played games from the cache. Default is False (delete the oldest game from the archive).

<ShowLoadingScreen>
Shows a simple loading screen while the game is being extracted. Note that this setting does not affect BigBox, for which the loading screen is never shown. Default is True.

<VerboseLogging>
Archive Cache Manager has extensive logging to aid in debugging, but this can also slow down the cache management due to the extra disk I/O. The default log behaviour is to now only log exceptions and other important events. Extended debug/verbose logging can be re-enabled with this setting. Default is False.

<ForceHardLinks>
The default Archive Cache Manager behaviour is to use the direct path to an archive in the archive cache. This eliminates the need for the previously used method of hardlinks and directory junctions linking the archive cache to LaunchBox's temp folder. This option forces the use of hardlinks/junctions. Default is False.

<ForceFileCopy>
This option overrides both the direct path and hardlink/junction behaviour described above. With this option enabled, a direct file copy will be made from the archive cache to the LaunchBox temp folder. Use this option if there are problems with the other two methods. Default is False.

<FilePriority>
This defines the file extension priority for the specified emulator (and optionally platform). The emulator name in the <Emulator> tag must match the emulator name set in LaunchBox. An optional <Platform> tag can be used for individual platform file extension priorities in a multi-system emulator (e.g. Retroarch). The file extensions in the <Extensions> tag are a comma separated list. Duplicate the entire <FilePriority> block to add new emulator (and platform) extension priorities.

In the example below, the Retroarch file priorities will only be applied to games belonging to either the 3DO or TurboGrafx-CD platforms. Games belonging to another platform started with Retroarch will not have a priority applied.
 

<FilePriority>
  <Emulator>PCSX2</Emulator>
  <Extensions>iso, bin</Extensions>
</FilePriority>
<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>


Known Issues

  • Loading screen game title is filename when game started as additional app
  • Cover art display doesn't yet use LaunchBox's image loading priority

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
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)?

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Good to hear the plugin is useful for you! I appreciate the feedback.

What you're proposing should be fairly easy to add. Expect an update in the coming days :)

  • Like 2
  • Thanks 1

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Yes, I understand what you mean, maybe it would be better as a separate plugin. Anyway, thanks for considering it! Maybe someday we will see it implemented :D

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
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. 

Share this post


Link to post
Share on other sites
On 22/03/2018 at 4:24 AM, Landcross said:

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

Now that LaunchBox.Next is out of beta, support has been added to the new release. I've only done some quick testing, so let me know if there any issues :)

  • Thanks 1

Share this post


Link to post
Share on other sites

Just to be clear to anyone who might read this and misinterpret things LB Next is still very much in beta but the beta is now included in the latest stable release.

  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks for the clarification. Yes, I meant that now that LB Next is included with official releases (not the beta releases). It's looking good btw, and very fast too.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

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...