summaryrefslogtreecommitdiff
path: root/doc/respack.md
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-03-12 16:34:45 +0100
committermetamuffin <metamuffin@disroot.org>2025-03-12 16:34:45 +0100
commit3ed621256f1e02032250477fa574eab38bd34976 (patch)
tree100f24b5a97a20cee87fd14b1a68e8250a6328f9 /doc/respack.md
parent56ffdcff01b57af14db97b4515b419da0d234387 (diff)
downloadweareserver-3ed621256f1e02032250477fa574eab38bd34976.tar
weareserver-3ed621256f1e02032250477fa574eab38bd34976.tar.bz2
weareserver-3ed621256f1e02032250477fa574eab38bd34976.tar.zst
respack
Diffstat (limited to 'doc/respack.md')
-rw-r--r--doc/respack.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/doc/respack.md b/doc/respack.md
new file mode 100644
index 0000000..eb316c0
--- /dev/null
+++ b/doc/respack.md
@@ -0,0 +1,22 @@
+# Resource Package Format
+
+Multiple related resources can be packages into a single file for easier
+distribution and storage outside of the game.
+
+A resource pack has a header describing the layout of the contained resources.
+It maps resource hashes to absolute offset-size ranges in file. There is no
+guarantee that the resource data is tightly packed in the file. There may also
+be an entry point resource specified which is of type `RespackEntry`, or not in
+which case the field is zeroed.
+
+```
+MMMM EEEEEEEE CC [RRRRRRRR OO SS]... Data...
+^ ^ ^ ^ ^ ^
+| | | | | | Size (u64)
+| | Entry Point Res | Offset (u64)
+| Magic bytes | | Resource hash (256-bit)
+ | Resources count
+```
+
+The magic bytes are `0f0c 5745 4152 4501 5245 5350 4143 4b02`
+(`\x0f\x0cWEARE\x01RESPACK\x02`).