Warrior Kings BCP: Difference between revisions

From XentaxWiki
Jump to navigation Jump to search
imported>Mr.Mouse
m (refitting to general applied structure)
imported>Ikskoks
m (Ikskoks moved page Warrior Kings to Warrior Kings BCP)
 
(17 intermediate revisions by 5 users not shown)
Line 1: Line 1:
= BCP =
* [[GRAFs|Return to the list of games]]


''' Format Type ''': Archive <br>
Choose archive extension:  
''' Endian Order ''': Little Endian <br>


== BCP ==


== Format Specifications ==
* ''' Format Type ''':    Archive <br>
* ''' [http://en.wikipedia.org/wiki/Endianness Endian Order] ''': Little Endian <br>


=== Format Specifications ===
This is actually for Warrior Kings Battles !<br>
<tt><b>
<tt><b>
byte {44}&nbsp;&nbsp;&nbsp; - Header <font color="purple">(PAK File 2.01 <font color="purple">(c)</font> Black Cactus Games Limited)</font> <br>  
char {44}&nbsp;&nbsp;&nbsp; - Header <font color="purple">(PAK File 2.01 (c) Black Cactus Games Limited)</font> <br>  
uint32 {4}&nbsp;&nbsp; - <font color="red"> '' Unknown '' </font> <br>  
uint32 {4}&nbsp;&nbsp; - <font color="red"> '' Unknown '' </font> <br>  
uint32 {4}&nbsp;&nbsp; - Directory Offset <br>  
uint32 {4}&nbsp;&nbsp; - Directory Offset <br>  
uint32 {4}&nbsp;&nbsp; - Directory Length <br>  
uint32 {4}&nbsp;&nbsp; - Directory Length <br>  
char {X}&nbsp;&nbsp;&nbsp;&nbsp; - File Data <br>
char {X}&nbsp;&nbsp;&nbsp;&nbsp; - Directory <br>
<br>
<br>
<font color="blue"> ''' // go to Directory Offset ''' </font> <br>  
byte {X}&nbsp;&nbsp;&nbsp;&nbsp; - File Data <br>  
<br>
<br>
<font color="blue"> ''' // Main Directory ''' </font> <br>
: uint32 {4}&nbsp;&nbsp; - Number Of Files <br>  
: uint32 {4}&nbsp;&nbsp; - Number Of Files <br>  
<br>
: <font color="blue"> ''' // for each file ''' </font> <br>  
: <font color="blue"> ''' // for each file ''' </font> <br>  
:: uint32 {4}&nbsp;&nbsp; - File Offset <br>  
:: uint32 {4}&nbsp;&nbsp; - File Offset <br>  
:: uint32 {4}&nbsp;&nbsp; - Offset To Next File <br>  
:: uint32 {4}&nbsp;&nbsp; - Offset To Next File <br>  
:: uint32 {4}&nbsp;&nbsp; - File Size <br>  
:: uint32 {4}&nbsp;&nbsp; - File Size <br>  
:: uint32 {4}&nbsp;&nbsp; - <font color="red"> '' Unknown <font color="purple">(Hash?)</font> '' </font> <br>  
:: uint32 {4}&nbsp;&nbsp; - <font color="red"> '' Hash? '' </font> <br>  
:: uint32 {4}&nbsp;&nbsp; - <font color="red"> '' File Type ID? '' </font> <br>  
:: uint32 {4}&nbsp;&nbsp; - <font color="red"> '' File Type ID? '' </font> <br>  
<br>
<br>
: <font color="blue"> ''' // for each directory ''' </font> <br>  
: <font color="blue"> ''' // for each directory { ''' </font> <br>  
:: <font color="blue"> ''' // NOTE: The next 3 fields don't appear in the first directory! ''' </font> <br>  
:: <font color="blue"> ''' // Note: The next 3 fields don't appear in the first directory! ''' </font> <br>  
:: uint32 {4}&nbsp;&nbsp; - Number Of Sub-Directories In This Directory <br>  
:: uint32 {4}&nbsp;&nbsp; - Number Of Sub-Directories In This Directory <br>  
:: byte {1}&nbsp;&nbsp;&nbsp;&nbsp; - Directory name Length <font color="darkgreen">[*2 for unicode]</font> <br>  
:: byte {1}&nbsp;&nbsp;&nbsp;&nbsp; - Directory name Length <font color="darkgreen">[*2 for unicode]</font> <br>  
Line 32: Line 37:
:: uint32 {4}&nbsp;&nbsp; - Number Of Files In Directory <font color="purple">(not including sub-directories)</font> <br>  
:: uint32 {4}&nbsp;&nbsp; - Number Of Files In Directory <font color="purple">(not including sub-directories)</font> <br>  
<br>
<br>
:: <font color="blue"> ''' // for each file in the directory ''' </font> <br>  
:: <font color="blue"> ''' // for each file in the directory { ''' </font> <br>  
::: uint32 {4}&nbsp;&nbsp; - File ID <font color="purple">(incremental, starting from 0)</font> <br>  
::: uint32 {4}&nbsp;&nbsp; - File ID <font color="purple">(incremental, starting from 0)</font> <br>  
::: uint64 {8}&nbsp;&nbsp; - <font color="red"> '' Unknown '' </font> <br>  
::: uint64 {8}&nbsp;&nbsp; - <font color="red"> '' Unknown '' </font> <br>  
::: byte {1}&nbsp;&nbsp;&nbsp;&nbsp; - Filename Length <font color="darkgreen">[*2 for unicode]</font> <br>  
::: byte {1}&nbsp;&nbsp;&nbsp;&nbsp; - Filename Length <font color="darkgreen">[*2 for unicode]</font> <br>  
::: char {X}&nbsp;&nbsp;&nbsp;&nbsp; - Filename <font color="purple">(unicode text - 2-bytes per letter)</font> <br>  
::: char {X}&nbsp;&nbsp;&nbsp;&nbsp; - Filename <font color="purple">(unicode text - 2-bytes per letter)</font> <br>  
::: <font color="blue"> ''' } ''' </font> <br>
<br>
<br>
:: <font color="blue"> ''' // for each sub-directory in this directory ''' </font> <br>  
:: <font color="blue"> ''' // for each sub-directory in this directory { ''' </font> <br>  
::: <font color="blue"> ''' // REPEAT FROM "//for each directory" ''' </font> <br>  
::: <font color="blue"> ''' // Repeat from "//for each directory" ''' </font> <br>  
<br>
::: <font color="blue"> ''' } ''' </font> <br>  
<br>
<br>
<br>
</b></tt>
</b></tt>


== Notes and Comments ==  
=== MultiEx BMS Script ===
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<br>
 
Not written yet<br><br>
 
=== Notes and Comments ===
 
* In Warrior Kings Battles, 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 chartacter in each pair, as the second byte will be null
* In Warrior Kings, the filenames are stored as normal text. The Tag is 'PAK File 0.06 ...' instead of 'PAK File 2.01 ...'. There may exist other differences between both formats.
<br><br>
=== Compatible Programs ===
 
* Warrior Kings Battles only : [[Game Extractor|Game Extractor]]<br>
 


When working out the directories, do the following...<br>
[[Category:File Format]]
1. Read the 4-byte field before the directory name<br>
2. If the field is 0, it means go back up a directory before creating the new directory<br>
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.<br>

Latest revision as of 22:39, 4 February 2021

Choose archive extension:

BCP


Format Specifications

This is actually for Warrior Kings Battles !
char {44}    - Header (PAK File 2.01 (c) Black Cactus Games Limited)
uint32 {4}   - Unknown
uint32 {4}   - Directory Offset
uint32 {4}   - Directory Length

byte {X}     - File Data

// Main Directory

uint32 {4}   - Number Of Files


// for each file
uint32 {4}   - File Offset
uint32 {4}   - Offset To Next File
uint32 {4}   - File Size
uint32 {4}   - Hash?
uint32 {4}   - File Type ID?


// 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)


// 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)
}


// for each sub-directory in this directory {
// Repeat from "//for each directory"
}


MultiEx BMS Script

Not written yet

Notes and Comments

  • In Warrior Kings Battles, 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 chartacter in each pair, as the second byte will be null
  • In Warrior Kings, the filenames are stored as normal text. The Tag is 'PAK File 0.06 ...' instead of 'PAK File 2.01 ...'. There may exist other differences between both formats.



Compatible Programs