Warrior Kings BCP: Difference between revisions
imported>Mr.Mouse m (fixing) |
imported>Mr.Mouse m (fixing) |
(No difference)
| |
Revision as of 07:53, 12 May 2005
BCP
Format Type : Archive
Endian Order : Little Endian
Format Specifications
byte {44} - Header (PAK File 2.01 (c) Black Cactus Games Limited)
uint32 {4} - Unknown
uint32 {4} - Directory Offset
uint32 {4} - Directory Length
char {X} - File Data
char {X} - Directory
// go to Directory Offset
- uint32 {4} - Number Of Files
- // for each file
- uint32 {4} - File Offset
- uint32 {4} - Offset To Next File
- uint32 {4} - File Size
- uint32 {4} - Unknown (Hash?)
- uint32 {4} - File Type ID?
- uint32 {4} - File Offset
- // for each directory
- // NOTE: The next 3 fields don't appear in the first directory!
- uint32 {4} - Number Of Sub-Directories In This Directory
- byte {1} - Directory name Length [*2 for unicode]
- char {X} - Directory name (unicode text - 2-bytes per letter)
- uint32 {4} - Number Of Files In Directory (not including sub-directories)
- // NOTE: The next 3 fields don't appear in the first directory!
- // for each file in the directory
- uint32 {4} - File ID (incremental, starting from 0)
- uint64 {8} - Unknown
- byte {1} - Filename Length [*2 for unicode]
- char {X} - Filename (unicode text - 2-bytes per letter)
- uint32 {4} - File ID (incremental, starting from 0)
- // for each file in the directory
- // for each sub-directory in this directory
- // REPEAT FROM "//for each directory"
- // REPEAT FROM "//for each directory"
- // for each sub-directory in this directory
MultiEx BMS Script
Not written yet
Notes and Comments
The filenames are stored as unicode text, which means that each character is stored as 2 bytes instead of 1. For ASCII text, it is sufficient to read only the first character in each pair, as the second byte will be null
When working out the directories, do the following...
1. Read the 4-byte field before the directory name
2. If the field is 0, it means go back up a directory before creating the new directory
3. Now create the new directory, and read the 4-byte "number" field after it. The 4-byte "number" field tells how many FILES are in the directory, but it does not include the number of sub-directories in the directory. Therefore it is quite feasable to have a directory with "number" == 0, but containing multiple sub-directories.