DBDF

From SC4D Encyclopaedia
Jump to navigation Jump to search

DBDF files (DataBase Directory Files, commonly referred to as just Directory or DIR files) are directories of all of the compressed files within a DBPF file. As such, a DBPF will contain a DBDF if any of its subfiles are compressed. The purpose of these resources is to speed up the loading of a DAT file by showing exactly what is compressed inside it. The TGI for a DBDF is always E86B1EEF E86B1EEF 286B1F03.

Format

DBDF files contain repeating 16 byte chunks giving information about a given subfile within the DBPF. In the DBPF version used in SimCity 4, with index table version 7.0, the format is as follows.

DWORD - Type ID of file
DWORD - Group ID of file
DWORD - Instance ID of file
DWORD - Size of file when decompressed, in bytes.

In DBPF's with version 7.1 index tables, the repeating chunk is 20 bytes, and it contains an entry for the Resource ID of the file (after the IID, before the size). This format is not used by SC4, but is mentioned here for completeness.

Notes

It is strongly recommended that you update the DBDF after editing any compressed file, and before saving the .dat if you are working manually in hex or making your own program.