Difference between revisions of "DatabasePackedFile"
(→File) |
(Cleaned up page) |
||
Line 55: | Line 55: | ||
:Reserved for future use in other versions. | :Reserved for future use in other versions. | ||
− | == | + | ==Index Table== |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
There are 2 known formats of indexes in the game. The format version is found in the file header. | There are 2 known formats of indexes in the game. The format version is found in the file header. | ||
Line 116: | Line 98: | ||
Holes are created when the game deletes something from a DBPF. The holes themselves are simply junk data of the appropriate length to fill the hole. | Holes are created when the game deletes something from a DBPF. The holes themselves are simply junk data of the appropriate length to fill the hole. | ||
+ | |||
+ | ==File== | ||
+ | Bulk of DBPF packages. Each file is either uncompressed or compressed. To check if a file is compressed you first need to read the [[DIR]] resource, if it exists. (See the corresponding entry for a description). If no DIR entry exists, then no files within the package are compressed. | ||
+ | |||
+ | ===Header=== | ||
+ | Only if the file is compressed | ||
+ | |||
+ | ;DWORD | ||
+ | :Compressed Size of file | ||
+ | ;WORD | ||
+ | :Compression ID (0x10FB) QFS Compression. (See [[packages]] for compression information) | ||
+ | ;3 bytes | ||
+ | :Uncompressed Size of file | ||
+ | |||
+ | See [[DBPF Compression]] for details of the compression scheme | ||
+ | |||
+ | ===Body=== | ||
+ | Raw data | ||
==See also== | ==See also== |
Revision as of 18:08, 29 December 2006
Archive format used for The Sims 2 and SimCity 4 archive data files.
Contents |
Format
Most Sims 2 Data is as you probably know stored in various types of archive files that all have the same internal format such as package, cache, etc. This format is proprietary to Maxis and has been used in the SimCity 4, and The Sims Online as well as this one.
Entries may be compressed with QFS compression depending on their entry data.
Overview
This is the general structure of DBPF packages:
Header (96 bytes) File 1 File 2 ... File n Index Entry 1 (20 bytes) Index Entry 2 ... Index Entry n
Header first, individual files following with no filenames and a small file header area at the beginning of each followed by an index of all the files in the archive.
Header
- DWORD
- Identifier (DBPF - the type of dat)
- DWORD
- Version Major (1 in TS2/SC4 Dats)
- DWORD
- Version Minor (0 in SC4 dats, 1 in most TS2 packages)
- 12 bytes
- Reserved (Users can store DBPF info data here if they want)
- DWORD
- Date Created in Hex (Unused in Version 1.1)
- DWORD
- Date Modified in Hex (Unused in Version 1.1)
- DWORD
- Index Major Version (Always 7 in TS2/SC4 dats)
- DWORD
- Number of entries in the index
- DWORD
- Location of first index entry
- DWORD
- Size of index
- DWORD
- Number of Hole entries in the Hole Record
- DWORD
- Location of the Hole Record
- DWORD
- Size of the Hole Record
- DWORD
- Index Minor Version (Version 1.1+ in TS2 only)
- 01 - 0
- 02 - 1
- 32 bytes
- Reserved for future use in other versions.
Index Table
There are 2 known formats of indexes in the game. The format version is found in the file header.
Version 7.0
(20 bytes, some DBPF 1.1 entries use this format)
- DWORD
- Type ID (see InternalFormats)
- DWORD
- Group ID
- DWORD
- Instance ID
- DWORD
- Location of the file in the archive
- DOWRD
- Size of the file
Version 7.1
(24 bytes)
- DWORD
- Type ID (see InternalFormats)
- DWORD
- Group ID
- DWORD
- Instance ID
- DWORD
- Second Instance ID
- DWORD
- Location of the file in the archive
- DOWRD
- Size of the file
Hole Record
A Hole record contains the location and size of all holes in a DBPF file.
- repeating
- DWORD
- Hole Location
- DWORD
- Hole size
Holes are created when the game deletes something from a DBPF. The holes themselves are simply junk data of the appropriate length to fill the hole.
File
Bulk of DBPF packages. Each file is either uncompressed or compressed. To check if a file is compressed you first need to read the DIR resource, if it exists. (See the corresponding entry for a description). If no DIR entry exists, then no files within the package are compressed.
Header
Only if the file is compressed
- DWORD
- Compressed Size of file
- WORD
- Compression ID (0x10FB) QFS Compression. (See packages for compression information)
- 3 bytes
- Uncompressed Size of file
See DBPF Compression for details of the compression scheme
Body
Raw data
See also
This article is imported from the old MTS2 wiki. It's original page, with comments, can be found at http://old_wiki.modthesims2.com/DatabasePackedFile