Difference between revisions of "DatabasePackedFile"

From SimsWiki
Jump to: navigation, search
(Auto-inserted from WakkaWikki)
 
(Massivly cleaned)
Line 1: Line 1:
{{OldWikiEntry}} Format of Simcity4 Archive data files
+
Archive format used for [[SimCity 4]] and [[The Sims 2]] archive data files.
--------------------------
+
  
Most simcity Data is as you probably know stored in various types of archive files that all have the same internal format such as DAT, SC4, SC4lot, etc. This format is proprietary to maxis and has been used in the Sims 2, and Sims online as well as this one.  
+
=Format=
 +
Most simcity Data is as you probably know stored in various types of archive files that all have the same internal format such as DAT, SC4, SC4lot, etc. This format is proprietary to Maxis and has been used in the Sims 2, and [[The Sims Online]] as well as this one.
  
 
Entries may be compressed with QFS compression depending on their entry data.
 
Entries may be compressed with QFS compression depending on their entry data.
  
Header (96 bytes)
+
==Overview==
File 1
+
This is the general structure of DBPF packages:
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 at 20 bytes per entry.
+
Header (96 bytes)
 +
File 1
 +
File 2
 +
...
 +
File n
 +
Index Entry 1 (20 bytes)
 +
Index Entry 2
 +
...
 +
Index Entry n
  
Header:
+
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.
  
Offset 00 - Identifier (DBPF - the type of dat)
+
==Header==
Offset 04 - Version Major (1 in SC4/Ts2 Dats)
+
;DWORD
Offset 08 - Version Minor (0 in sc4 dats, 1 in most TS2 packages)
+
:Identifier (DBPF - the type of dat)
Offset 12 - DWORD[3] Reserved (Users can store DBPF info data here if they want)
+
;DWORD
Offset 24 - Date Created in Hex (Unused in Version 1.1)
+
:Version Major (1 in SC4/Ts2 Dats)
Offset 28 - Date Modified in Hex (Unused in Version 1.1)
+
;DWORD
Offset 32 - Index Type/Version (Always 7 in SC4/TS2 dats)
+
:Version Minor (0 in sc4 dats, 1 in most TS2 packages)
Offset 36 - Number of entries in the index  
+
;12 bytes
Offset 40 - Location of first index entry  
+
:Reserved (Users can store DBPF info data here if they want)
Offset 44 - Size of index  
+
;DWORD
Offset 48 - Number of Hole entries in the Hole Record
+
:Date Created in Hex (Unused in Version 1.1)
Offset 52 - Location of the hole Record
+
;DWORD
Offset 56 - Size of the hole Record
+
:Date Modified in Hex (Unused in Version 1.1)
Offset 60 - Index Version 01 = 7.0, 02 = 7.1 (Version 1.1+ in TS2 only)
+
;DWORD
Offset 64 - 32 Bytes reserved for Future Use in other versions.
+
:Index Type/Version (Always 7 in SC4/TS2 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 Version (Version 1.1+ in TS2 only)
 +
:*01 - 7.0
 +
:*02 - 7.1
 +
;32 bytes
 +
:Reserved for future use in other versions.
  
File: (If files are uncompressed, they start at offset 0, if they are compressed, there are 9 byte headers of this format)
+
==File==
 +
Bulk of DBPF packages.
  
Offset 00 - Compressed Size of file
+
===Header===
Offset 04 - Compression ID (0x10FB) QFS Compression. (Compression spec is seperate covered on the [[packages]] page)
+
Only if the file is compressed
Offset 06 - Uncompressed Size of file
+
Offset 09 - Start of compressed/uncompressed file data
+
  
 +
;DWORD
 +
:Compressed Size of file
 +
;WORD
 +
:Compression ID (0x10FB) QFS Compression. (Compression spec is seperate covered on the [[packages]] page)
 +
;3 bytes
 +
:Uncompressed Size of file
  
 +
===Body===
 +
Raw data
 +
 +
==File Table==
 
There are now 2 known formats of indexes in the game. To determine your version, read offset 60 in version 1.1 or use 7.0 for version 1.0 DBPFs.
 
There are now 2 known formats of indexes in the game. To determine your version, read offset 60 in version 1.1 or use 7.0 for version 1.0 DBPFs.
  
The size of an index entry in version 1.0 is 20 bytes, like this:
+
===Version 7.0===
(Version 1.0 and some 1.1's) (7.0)
+
(20 bytes, some 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
  
Offset 00 - Type ID (main type of file. picture, texture, model etc)
+
===Version 7.1===
Offset 04 - Group ID (group of the file by purpose or type)
+
(24 bytes)
Offset 08 - Instance ID (marker used by the format for finding a specific file)
+
Offset 12 - Location of the file in the archive
+
Offset 16 - Size of the file
+
  
And 24 bytes in many 1.1 DBPFs (7.1)
 
  
Offset 00 - Type ID (main type of file. picture, texture, model etc)
+
;DWORD
Offset 04 - Group ID (group of the file by purpose or type)
+
:Type ID (see [[InternalFormats]])
Offset 08 - Instance ID (marker used by the format for finding a specific file)
+
;DWORD
Offset 12 - Instance ID 2 (Second Instance ID for GUID Based systems in TS2)
+
:Group ID
Offset 16 - Location of the file in the archive  
+
;DWORD
Offset 20 - Size of the file  
+
:Instance ID
 +
;DWORD
 +
:Second Instance ID
 +
;DWORD
 +
:Location of the file in the archive  
 +
;DOWRD
 +
:Size of the file  
  
HOLE RECORD
+
==Hole Record==
-----------
+
A Hole record contains the location and size of all holes in a DBPF file.
A Hole record contains the location and size of all holes in a DBPF file. Its format is as follows
+
  
(repeating)
+
;repeating
DWORD - Hole Location
+
;DWORD
DWORD - Hole size
+
: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.
 
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.
  
 +
{{OldWikiEntryCleaned}}
  
[[Category:Modding]]
+
[[Category:Modding]]
 +
[[Category:InternalFormats]]

Revision as of 03:30, 12 July 2006

Archive format used for SimCity 4 and The Sims 2 archive data files.

Contents

Format

Most simcity Data is as you probably know stored in various types of archive files that all have the same internal format such as DAT, SC4, SC4lot, etc. This format is proprietary to Maxis and has been used in the Sims 2, 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 SC4/Ts2 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 Type/Version (Always 7 in SC4/TS2 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 Version (Version 1.1+ in TS2 only)
  • 01 - 7.0
  • 02 - 7.1
32 bytes
Reserved for future use in other versions.

File

Bulk of DBPF packages.

Header

Only if the file is compressed

DWORD
Compressed Size of file
WORD
Compression ID (0x10FB) QFS Compression. (Compression spec is seperate covered on the packages page)
3 bytes
Uncompressed Size of file

Body

Raw data

File Table

There are now 2 known formats of indexes in the game. To determine your version, read offset 60 in version 1.1 or use 7.0 for version 1.0 DBPFs.

Version 7.0

(20 bytes, some 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.

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

Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox