GTA Wiki
Advertisement
GTA Wiki
15,350
pages

RenderWare binary stream files are hierarchically structured binary data files used by the RenderWare 3.x graphics engine utilized by Rockstar North for their GTA III trilogy (only on PC, PS2 and XBOX, not PSP!) and related games (Manhunt, Bully).

GTA's model files use the file extension .dff and texture archives use .txd. Other possible extensions, not used by the GTA games, are .rws, .bsp and .dma. GTA3 does use .anm for some of its cutscene animations, but it is the only GTA to do so.

File Format

RW streams are split up into sections. Each section has a 12 byte header and can either be empty, contain data or more child sections. Section content, especially of data sections, is determined by an ID in the header.

There is only one data structure common to all RW streams - the section header:

4 byte - DWORD - section identifier
4 byte - DWORD - section size, including child sections and/or data
4 byte - DWORD - RW version ID

The RW version ID varies depending on the RW engine version used for exporting the files. It must be the same for all headers within one file. Backwards compatibility is very limited.

Valid RW Section IDs

See the list of RW section IDs.

Rockstar's Custom Section IDs

Rockstar added several vendor specific RW plugins, which have their own ID range (0x0253F2F*).

  • Pipeline Set (0x0253F2F3)
  • Specular Material (0x0253F2F6)
  • 2dfx (0x0253F2F8)
  • Night Vertex Colors (0x0253F2F9)
  • Collision Model (0x0253F2FA)
  • Reflection Material (0x0253F2FC)
  • Mesh Extension (0x0253F2FD)
  • Frame (0x0253F2FE)

Common RW Version IDs

The following is an (incomplete) list of plain text RW versions commonly used in GTA and their encoded equivalent:

3.0.0.3 - 0x0003FFFF
3.?.?.? - 0x0800FFFF (GTA III)
3.1.0.0 - 0x00000310 (GTA III)
3.3.0.2 - 0x0C02FFFF (GTA VC)
3.4.0.3 - 0x1003FFFF (GTA VC)
3.6.0.3 - 0x1803FFFF (GTA SA)

Common File Structures

Model Files (DFF)

  • Clump
    • Struct
    • Frame List
      • Struct
      • Extension *
        • Frame
        • HAnim PLG
    • Geometry List
      • Struct
      • Geometry *
        • Struct
        • Material List
          • Struct
          • Material *
            • Struct
            • Texture - optional
              • Struct
              • String - diffuse texture name
              • String - alpha texture name
              • Extension
                • Sky Mipmap Val **
            • Extension
              • Specular Material - optional, vehicles only
              • Reflection Material - optional, vehicles only
              • Material Effects PLG - optional, vehicles only
              • Texture - optional
                only occurs with the section above, possibly even a child section
                • Struct
                • String - environment map name
                • String - alpha texture name
                • Extension
                  • Sky Mipmap Val **
        • Extension
          • Bin Mesh PLG
          • Native Data PLG (on Xbox and PS2)
          • 2dfx
          • Night Vertex Colors - static objects only
          • Mesh Extension
    • Atomic *
      • Struct
      • Extension
        • Right To Render - vehicles only
        • Material Effects PLG - vehicles only
    • Extension
      • Collision Model - vehicles only

Texture Archives (TXD)

  • Texture Dictionary
    • Struct - 4 byte, 2x word, first one is the texture count
    • Texture Native *
      • Struct - header and actual image data
      • Extension - empty
    • Extension - empty

Texture Archives PS2 (TXD)

  • Texture Dictionary
    • Struct - 2b - Texture count, 2b - unknown
    • Texture Native *
      • Struct - 4b - Platform, 4b- Filter Flags
      • String - Texture name
      • String - Alpha name
      • Struct
        • Struct - 4b- Width, 4b - Height, 4b - Bits per pixel, unknown
        • Struct - 80 bytes unknown, pixels/indices (80 bytes unknown, palette)
      • Extension
        • Sky Mipmap Val (RW Section) - 4 bytes unknown
    • Extension - empty

* These sections (and their child sections) can appear multiple times.

** Not always present, effect also unknown.

A byte may contain two indices, if bpp == 4.

16 bit images are in 1555 ARGB format.

The indices are swizzled and saved in a PS2 friendly format (CLUT).

Note: There are slight differences between GTA: III and VC formats concerning the raster/image format.

Tools & Scripts

See also


Copyrighted

This page is licensed under the GNU Free Documentation Licence. This page has a separate license to the CC-BY-SA that applies to most of GTA Wiki.

The full text of the GNU FDL v1.2 is here. Click the "History" button to see the full list of authors. See GTA Wiki:Copyright for more detail on our copyright policy.

Advertisement