Sacred: Difference between revisions

From XentaxWiki
Jump to navigation Jump to search
imported>Paul Siramy
imported>Ikskoks
(Redirected page to Sacred PAK)
 
(39 intermediate revisions by 3 users not shown)
Line 1: Line 1:
* [[GRAFs|Return to the list of games]]
#REDIRECT [[Sacred PAK]]
 
Choose archive extension:
 
== PAK ==
 
* ''' Format Type ''':    Archive <br>
* ''' [http://en.wikipedia.org/wiki/Endianness Endian Order] ''': Little Endian <br>
 
 
=== Format Specifications ===
 
<tt><b>
byte {3}&nbsp;&nbsp;&nbsp;&nbsp; - Header <br>
byte {1}&nbsp;&nbsp;&nbsp;&nbsp; - Version <br>
<br>
<font color="blue"> ''' if (header == TEX && version == 3){ ''' </font> <br>
: <font color="purple"> '' // PAK\Texture*.pak '' </font> <br>
: uint32 {4}&nbsp;&nbsp; - Number Of Files <br>
: uint32 {4}&nbsp;&nbsp; - <font color="red"> '' Unknown '' </font> <br>
: byte {244}&nbsp;&nbsp; - null <br>
<br>
: <font color="blue"> ''' // for each file ''' </font> <br>
:: uint32 {4}&nbsp;&nbsp; - Type ID <br>
:: uint32 {4}&nbsp;&nbsp; - Offset <br>
:: uint32 {4}&nbsp;&nbsp; - Compressed Size <br>
<br>
: <font color="blue"> ''' // for each file ''' </font> <br>
:: char {32}&nbsp;&nbsp;&nbsp; - Filename <font color="purple">(null)</font> <br>
:: uint16 {2}&nbsp;&nbsp; - X Image Size <br>
:: uint16 {2}&nbsp;&nbsp; - Y Image Size <br>
:: byte {1}&nbsp;&nbsp;&nbsp;&nbsp; - Type ID <br>
:: uint32 {4}&nbsp;&nbsp; - Compressed Size <br>
:: byte {39}&nbsp;&nbsp;&nbsp; - null Padding <br>
:: byte {X}&nbsp;&nbsp;&nbsp;&nbsp; - File Data <br>
<font color="blue"> ''' } ''' </font> <br>
<font color="blue"> ''' else if (header == ISO && version == 3){ ''' </font> <br>
: <font color="purple"> '' // PAK\Tiles.pak '' </font> <br>
: uint32 {4}&nbsp;&nbsp; - Number Of Files <br>
: uint32 {4}&nbsp;&nbsp; - Number Of Files <font color="purple"> '' Yep, again '' </font> <br>
: byte {244}&nbsp;&nbsp; - null <br>
<br>
: <font color="blue"> ''' // for each file ''' </font> <br>
:: uint32 {4}&nbsp;&nbsp; - Tag_66 <font color="purple"> '' Always = 66 '' </font> <br>
:: uint32 {4}&nbsp;&nbsp; - Offset <br>
:: uint32 {4}&nbsp;&nbsp; - Tag_64 <font color="purple"> '' Always = 64 '' </font> <br>
<br>
: <font color="blue"> ''' // for each file ''' </font> <br>
:: char {32}&nbsp;&nbsp;&nbsp; - Filename <font color="purple">(null)</font> <br>
:: uint32 {4}&nbsp;&nbsp; - Entry Index within the file PAK\Texture.pak (Header = TEX) <br>
:: uint32 {4}&nbsp;&nbsp; - Tile position within texture image <font color="purple"> '' Range from 0 to 17 '' </font> <br>
:: byte {6}&nbsp;&nbsp;&nbsp;&nbsp; - null <br>
:: byte {1}&nbsp;&nbsp;&nbsp;&nbsp; - Tag_1 <font color="purple"> '' Always = 1 '' </font> <br>
:: byte {17}&nbsp;&nbsp;&nbsp; - null <br>
<font color="blue"> ''' } ''' </font> <br>
<font color="blue"> ''' else if (header == CIF && version == 0){ ''' </font> <br>
: <font color="purple"> '' // PAK\Creature.pak '' </font> <br>
: uint32 {4}&nbsp;&nbsp; - Number Of Files <br>
: uint32 {4}&nbsp;&nbsp; - <font color="red"> '' Unknown '' </font> <br>
: byte {244}&nbsp;&nbsp; - null <br>
<br>
: <font color="blue"> ''' // for each file ''' </font> <br>
:: byte {64}&nbsp;&nbsp;&nbsp; - File Data <br>
<font color="blue"> ''' } ''' </font> <br>
<font color="blue"> ''' else if (header == WPN && version == 8){ ''' </font> <br>
: <font color="purple"> '' // PAK\Weapon.pak '' </font> <br>
: uint32 {4}&nbsp;&nbsp; - Number Of Files <br>
: uint32 {4}&nbsp;&nbsp; - <font color="red"> '' Unknown '' </font> <br>
<br>
: <font color="blue"> ''' // for each file ''' </font> <br>
:: byte {322}&nbsp;&nbsp; - File Data <br>
<font color="blue"> ''' } ''' </font> <br>
<font color="blue"> ''' else if (header == SND && version == 1){ ''' </font> <br>
: <font color="purple"> '' // PAK\Sound.pak '' </font> <br>
: uint32 {4}&nbsp;&nbsp; - Number Of Files <br>
: uint32 {4}&nbsp;&nbsp; - <font color="red"> '' Unknown '' </font> <br>
: byte {244}&nbsp;&nbsp; - null <br>
<br>
: <font color="blue"> ''' // for each file ''' </font> <br>
:: uint32 {4}&nbsp;&nbsp; - Type ID <br>
:: uint32 {4}&nbsp;&nbsp; - Offset <br>
:: uint32 {4}&nbsp;&nbsp; - Compressed Size <br>
<font color="blue"> ''' } ''' </font> <br>
<font color="blue"> ''' else if (header == ITM && version == 5){ ''' </font> <br>
: <font color="purple"> '' // PAK\Items*.pak '' </font> <br>
: uint32 {4}&nbsp;&nbsp; - Number Of Files <br>
: uint32 {4}&nbsp;&nbsp; - <font color="red"> '' Unknown '' </font> <br>
: byte {244}&nbsp;&nbsp; - null <br>
<br>
: <font color="blue"> ''' // for each file ''' </font> <br>
:: uint32 {4}&nbsp;&nbsp; - Type ID <br>
:: uint32 {4}&nbsp;&nbsp; - Offset <br>
:: uint32 {4}&nbsp;&nbsp; - Compressed Size <br>
<br>
: <font color="blue"> ''' // for each file ''' </font> <br>
:: byte {56}&nbsp;&nbsp;&nbsp; - <font color="red"> '' Unknown '' </font> <br>
:: char {32}&nbsp;&nbsp;&nbsp; - Filename <font color="purple">(null)</font> <br>
:: byte {X}&nbsp;&nbsp;&nbsp;&nbsp; - File Data <br>
<font color="blue"> ''' } ''' </font> <br>
<font color="blue"> ''' else if (header == ITM && version == 3){ ''' </font> <br>
: <font color="purple"> '' // PAK\Items*.pak ? I don't have ITM file(s) with version = 3, in Sacred+'' </font> <br>
: uint32 {4}&nbsp;&nbsp; - Number Of Files <br>
: uint32 {4}&nbsp;&nbsp; - <font color="red"> '' Unknown '' </font> <br>
: byte {244}&nbsp;&nbsp; - null <br>
<br>
: <font color="blue"> ''' // for each file ''' </font> <br>
:: uint32 {4}&nbsp;&nbsp; - Type ID <br>
:: uint32 {4}&nbsp;&nbsp; - Offset <br>
:: uint32 {4}&nbsp;&nbsp; - Compressed Size <br>
<br>
: <font color="blue"> ''' // for each file ''' </font> <br>
:: char {32}&nbsp;&nbsp;&nbsp; - Filename <font color="purple">(null)</font> <br>
:: byte {X}&nbsp;&nbsp;&nbsp;&nbsp; - File Data <br>
<font color="blue"> ''' } ''' </font> <br>
<font color="blue"> ''' else if (header == MDL && version == 3){ ''' </font> <br>
: <font color="purple"> '' // PAK\Models*.pak '' </font> <br>
: <font color="red"> '' Unknown '' </font>
<font color="blue"> ''' } ''' </font> <br>
<font color="blue"> ''' else if (header == MHP && version == 1){ ''' </font> <br>
: <font color="purple"> '' // PAK\Motions.pak '' </font> <br>
: <font color="red"> '' Unknown '' </font>
<font color="blue"> ''' } ''' </font> <br>
<font color="blue"> ''' else if (header == MIX && version == 0){ ''' </font> <br>
: <font color="purple"> '' // PAK\Mixed.pak '' </font> <br>
: <font color="red"> '' Unknown '' </font>
<font color="blue"> ''' } ''' </font> <br>
<font color="blue"> ''' else if (header == OBJ && version == 1){ ''' </font> <br>
: <font color="purple"> '' // World\Floor.pak, World\Static.pak, '' </font> <br>
: <font color="red"> '' Unknown '' </font>
<font color="blue"> ''' } ''' </font> <br>
<font color="blue"> ''' else if (header == SPF && version == 1){ ''' </font> <br>
: <font color="purple"> '' // PAK\sndProfiles.pak '' </font> <br>
: <font color="red"> '' Unknown '' </font>
<font color="blue"> ''' } ''' </font> <br>
<font color="blue"> ''' else if (header == TRG && version == 1){ ''' </font> <br>
: <font color="purple"> '' // World\Triggers.pak '' </font> <br>
: <font color="red"> '' Unknown '' </font>
<font color="blue"> ''' } ''' </font> <br>
</b></tt>
<br>
 
=== File Data Format in TEX (textures) PAK ===
 
<tt>
This is a simple zlib-compressed image, as the first character of the File Data indicates (it's an 'x'). The size of this File Data is 'Compressed Size' bytes, the size of the uncompressed file is :<br><br>
<b>&nbsp;&nbsp;&nbsp;Uncompressed File Data Size = (X Image Size) * (Y Image Size) * 2</b><br><br>
Once uncompressed, you have directly the pixels. Each pixel is an unsigned word (16 bits). It contains Alpha, Red, Green and Blue componant values, and each are 4 bits. A mapping of these bits would give :<br>
<br>
<b>&nbsp;&nbsp;&nbsp;(highest bit) AAAARRRRGGGGBBBB (lowest bit)</b><br>
<br>
The encoding of the pixel is Top to Bottom, and for each line is Left to Right. Note : the Alpha channel IS really used (it's not just for padding), check H_KEULE_02_1.TGA from texture00.pak for a good example (16 levels of alpha here)<br>
<br>
</tt>
 
=== MultiEx BMS Script ===
 
Not written yet<br><br>
 
=== Compatible Programs ===
 
* [[Game Extractor|Game Extractor]]<br>

Latest revision as of 19:19, 25 July 2021

Redirect to: