TankArchive

From XentaxWiki
Jump to: navigation, search

DS2MAP, DS2RES


Format Specifications

=== BASE ===
char {4}     - ProductId (DSg2)//ID of product (human readable) - always PRODUCT_ID
char {4}     - TankId (Tank)//ID of tank (human readable) - always TANK_ID
DWORD {4}    - HeaderVersion //version of this particular header
DWORD {4}    - DirSetOffset //(Offset to the start of Index 1)
DWORD {4}    - FileSetOffset // (Offset to the start of Index 3)
DWORD {4}    - IndexSize //total size of index (header plus all dir data - used for RAW format)
DWORD {4}    - DataOffset //offset to start of data (used for RAW format)
=== Extra - Basic ===
BYTE {12}    - ProductVersion //product version this tank was built with
BYTE {12}    - MinimumVersion //minimum product version required to use this tank
DWORD {4}    - Priority //priority that this tank is entered into the master index
DWORD {4}    - Flags //flags regarding this tank (eTankFlags)
char {4}     - CreatorId //"!GPG" who created this tank (creation tool will choose, not user)
GUID {36}    - //true GUID assigned at creation time
DWORD {4}    - IndexCRC32 //CRC-32 of just the index (not including the header)
DWORD {4}    - DataCRC32 //CRC-32 of just the data
SYSTEMTIME {16}   - UtcBuildTime //when this tank was constructed (stored in UTC)
WCHAR {200}  - Copyright Information ("Copyright (C) 1998-2004 Gas Powered Games. All rights reserved") (unicode text) (null terminated)
WCHAR {200}  - BuildText //text about how this was built
=== Extra - User Info ===
WCHAR {200}  - TitleText //title of this tank
WCHAR {100}  - AuthorText //who made this tank
//for GPG package, there're 24BYTE padding at here. But for user created package, there're nothing. byte {X}     - File Data


// INDEX 1 (Directories)

uint32 {4}   - Number Of Directories  in Total
// for each directory
uint32 {4}   - Offset to directory details (pointer into Index 2)


// INDEX 2 (Directories and Files)

// for each file or sub-directory
uint32 {4}    - Number Of Sub-Directories or Files
uint32 {4}    - Offset To Sub-Directory or File (relative to the Index 1, points to Index 2 or 4
uint32 {4}    - Offset To Parent Directory (relative to the Index 1)
uint32 {4}    - Number Of Files or Directory
FILETIME {8}  - Time Stamp
uint16 {2}    - Name Length
char {X}      - Name
byte {1-4}    - null Padding to a multiple of 4 bytes

byte {16}    - null Padding

// INDEX 3 (Files)
uint32 {4}   - Number Of Files  in Total
// for each directory
uint32 {4}   - Offset to file details (relative to Index 3, points to Index 4)

// INDEX 4 (Files)
// for each file
uint32 {4}   - Offset To Parent Directory (relative to Index 1 Offset)
uint32 {4}   - Decompressed Length
uint32 {4}   - File Offset (points to datarelative to dataOffset)
uint32 {4}   - CRC32
FILETIME {8} - Time Stamp 
uint32 {4}   - Compression Format (0 -> Not compressed, 1 -> Compressed ZLIB)
uint16 {2}   - Filename Length
char {X}     - Filename
byte {1-4}   - null Padding so each File Index is a multiple of 4 bytes

if (compressionTag == 1){
uint32 {4}   - Compressed Length
uint32 {4}   - Maximum Chunk Size (16384)

while (MoreDetailsMarker != 0){
uint32 {4}   - Decompressed Size Of Chunk
uint32 {4}   - Compressed Size Of Chunk [each chunk has a non-compressed 16 bytes added at the end]
uint32 {4}   - More Details Marker (0=no more comp data, 16=another comp data follows)
uint32 {4}   - Chunk Offset (points to datarelative to dataOffset)
}

}

MultiEx BMS

Not written yet

Notes and Comments

  • Compressed files use ZLib compression, broken up into separate ZLib chunks of size 16384 rather than compressing the whole file as a single chunk.

Supported Programs