#archive #package #resource #asset

respk

Manage resource files using a fast, custom open format designed especially for use in games

3 releases

0.1.2 Aug 30, 2018
0.1.1 Jul 17, 2017
0.1.0 Jul 17, 2017

#28 in Games

Download history 1/week @ 2018-06-07 10/week @ 2018-06-14 2/week @ 2018-06-21 5/week @ 2018-06-28 6/week @ 2018-07-05 2/week @ 2018-07-12 6/week @ 2018-07-19 8/week @ 2018-08-02 10/week @ 2018-08-09 2/week @ 2018-08-16 2/week @ 2018-08-23 5/week @ 2018-08-30

19 downloads per month

MIT license

15KB
299 lines

ResPK

ResPK is a fast and open SQLite-based archive format specifically designed for storing game resources.

Build Status Crates.io Documentation License

Overview

ResPK (Resource PacKage) is an archive format designed for bundling game resources, such as data files, images, sounds, music, and videos together into fewer larger files. Bundling resources together can improve performance and also makes it easier to do distribution and patching.

The file format is simply a SQLite database file with a particular schema. SQLite works well in this situation, as it is an open format that can be easily viewed with many tools, offers high performance for random row access, and allows concurrent reads. Being just a SQLite database also allows you to add any custom extra data or metadata you might need into your own ResPK archives while maintaining compatibility.

All resources are compressed individually using the fantastic LZ4 compression algorithm, which offers a decent amount of compression at blazing fast speed. While not as space-efficient as ZLIB or LZMA, the speed of LZ4 actually outweighs the speed of reading from most storage devices, which means it is actually faster to read a LZ4-compressed file from disk than an uncompressed file due to the reduced reads.

Features

  • Fast random access: Designed from the get-go to give really fast read times and random access.
  • Compression: Provides per-file compression to reduce overall file size and also to improve speed.
  • Streaming: Resources can be read incrementally from disk using on-the-fly decompression.
  • Lightweight: The library contains minimal dependencies to keep it lightweight.

Installation

Add this to your Cargo.toml file:

[dependencies]
respk = "0.1"

License

Available under the MIT license. See the LICENSE file for more info.

Dependencies

~11MB
~190K SLoC