User Tools

Site Tools


utf:universal_tree_format

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
utf:universal_tree_format [2019/04/17 17:47]
treewyrm
utf:universal_tree_format [2019/04/17 17:52] (current)
treewyrm
Line 1: Line 1:
 ====== Universal Tree Format ====== ====== Universal Tree Format ======
  
-Binary format used by most content assets in Freelancer. Stores hierarchical structure with named nodes and arbitrary fixed length binary content. Not to dissimilar to XML but significantly simpler.+Binary format used by most content assets in Freelancer. Stores hierarchical structure with named nodes (called entries) ​and arbitrary fixed length binary content. Not too dissimilar to XML but significantly simpler.
  
 ===== Header ===== ===== Header =====
Line 31: Line 31:
 | 0x00 | uint32 | Next sibling offset | | | 0x00 | uint32 | Next sibling offset | |
 | 0x04 | uint32 | Dictionary name offset | | | 0x04 | uint32 | Dictionary name offset | |
-| 0x08 | uint32 | Entry type | Directory or file |+| 0x08 | uint32 | Entry type | Directory or file (see: Win32 API dwFileAttributes) ​|
 | 0x0C | uint32 | Sharing attributes | | | 0x0C | uint32 | Sharing attributes | |
 | 0x10 | uint32 | Child or data offset | Offset to child entry if type is 0x80 or to data if type is 0x10 | | 0x10 | uint32 | Child or data offset | Offset to child entry if type is 0x80 or to data if type is 0x10 |
-| 0x14 | uint32 | Allocated data size | | +| 0x14 | uint32 | Allocated data size | Allocated data byte length. ​
-| 0x18 | uint32 | Used data size | | +| 0x18 | uint32 | Used data size | Actually used data byte length. ​
-| 0x20 | uint32 | Uncompressed data size | |+| 0x20 | uint32 | Uncompressed data size | Same as above. ​|
 | 0x24 | uint32 | Creation time | | | 0x24 | uint32 | Creation time | |
 | 0x28 | uint32 | Last access time | | | 0x28 | uint32 | Last access time | |
Line 47: Line 47:
  
   * In Freelancer UTFs first byte is always 0. Entries present in tree but no longer referenced (marked for deletion?) have their name offsets at 0 as well.   * In Freelancer UTFs first byte is always 0. Entries present in tree but no longer referenced (marked for deletion?) have their name offsets at 0 as well.
 +
 +===== Alignment =====
 +
 +Freelancer UTFs do 32-bit alignment by adding padding to names dictionary and to each data if necessary. The game however does not require alignment and can work with non-aligned UTFs.
utf/universal_tree_format.txt · Last modified: 2019/04/17 17:52 by treewyrm