exch-bms2 / beatoraja

Cross-platform rhythm game based on Java and libGDX.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support loading song assets from a zip file

lewisfff opened this issue · comments

Currently, loading a song in Beatoraja requires loading in images, videos and sound files stored in the file system. I propose adding support for loading a generic archive file which contains the sound files and background video/images.

Why?

  • Faster file transfers: Moving a single archive is faster than individual files, especially when transferring them across different locations in Windows.

  • File compression: By archiving the assets, we can compress them and save disk space.

Implementation

  • Archive all the assets for each song into a single zip file, except for chart files, preview sounds, and preview images. These files should be left out of the archive so that they can be accessed in the DECIDE menu without extracting.
Example comparison

Before:

image

After:

image

  • Modify the song loading process to check for a 'package.zip' file in the song directory and unpack it into memory if it exists. If not, load the assets as usual.

Does anyone have thoughts on this, if it should be done, how it could be implemented, any complexities?

Even uncompressed archive files can save spaces if there are thousands of BMS files. see Size on disk in the first image, due to sector size. (something like minimum unit to save file(allocation))
Waste of 15.2GiB in my case. (NTFS, sector size 4096 bytes)
image

This greatly helps distributing level tables via torrenting: Torrent doesn't work well with LARGE number of files. This could greatly reduce number of files, therefore making torrent feasible.