This repository was archived by the owner on Oct 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Relic Chunky
Marcus Kertesz edited this page Jul 9, 2022
·
2 revisions
A File Format for Game Assets.
| Start | Stop | Size (bytes) | Name | Expected Value | Type | Notes |
|---|---|---|---|---|---|---|
| 0 | 11 | 12 | Magic Word | 'Relic Chunky' | String (ascii) | |
| 12 | 15 | 4 | Line End | '\r\n\x1a\0' | String (ascii) | Four different terminal characters. |
| 16 | 19 | 4 | Version | '1' | UInt32 | Version for the chunky file. |
| 20 | 23 | 4 | Platform | '1' | UInt32 | Other tools refer to this as platform; perhaps for console releases? 1 appears to be PC |
For more information, see Reading Chunks and Relic Chunky Formats.
| Start | Stop | Size (bytes) | Name | Expected Value | Type | Notes |
|---|---|---|---|---|---|---|
| 0 | 3 | 4 | Type | 'FOLD' or 'DATA' | String (ascii) | |
| 4 | 7 | 4 | Id | N\A | String (ascii) | AKA The Subtype of the chunk. |
| 8 | 11 | 4 | Version | N\A | String (ascii) | |
| 12 | 15 | 4 | Chunk Size | N\A | Int32 | For Brevity; 'Cx' |
| 16 | 19 | 4 | Name Size | N\A | Int32 | For Brevity; 'Nx' |
| 20 | 19 +Nx | Nx | Name | N\A | String (ascii) | |
| 20 +NX | 19 +Nx + Cx | Cx | Data | N\A | Bytes |
Type is 'DATA'
Data chunks can be read as is. For more specific info, see Relic Chunky Data Formats.
Type is 'FOLD'
Folder chunks 'Data' contains additional Chunks.
See Reading Chunks for more information.
Regardless of whether it is the root Relic Chunky or a Folder Chunk; chunks are read in the same way.
Read in a chunk one at a time, until no more bytes are available.
If there are excess bytes OR missing bytes, then one of the following may have occurred:
- The file is not a valid chunky. (Most likely)
- A read failure occurred. (I won't rule this out since Python was not built for structured data, meaning I have to do it manually.)
- This format is wrong. (I doubt it seeing as how I've gotten pretty far with it, but still possible.)
One final thought for reading in Chunks. There is NOT a special 'Terminal' Chunk, excess 0 bytes should be considered a read failure, or signs of an invalid chunky.