Difference between revisions of "RpClump"

From GTAMods Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
 
{{RW Section|Clump|0x0010}}
 
{{RW Section|Clump|0x0010}}
  
'''Clump''' is usually the root section of [[model file|DFF files]]. It only contains child sections and no data. All additional data is stored inside a [[Struct_(RW_Section)|struct section]]. A clump section may appear multiple times inside one <code>.dff</code> files. There is no counting variable stored inside the file defining how many clumps are stored inside it.
+
A '''Clump''' is a container for Frames, [[Atomic (RW Section)|Atomics]], [[Light (RW Section)|Light]] and [[Camera (RW Section)|Cameras]].
 +
In a binary stream a Clump's child chunks are a [[Struct (RW Section)|Struct]] (described below), a [[Frame List (RW Section)|Frame List]], a [[Geometry List (RW Section)|Geometry List]], a number of [[Atomic (RW Section)|Atomics]], optionally a number of Structs and [[Light (RW Section)|Lights]] and a number of Structs and [[Camera (RW Section)|Cameras]] (Cameras are unused in GTA).
 +
Mulitple Clumps may appear inside one <code>.dff</code> file. There is no counting variable stored inside the file defining how many Clumps are stored inside it.
  
 +
Cameras and Lights as part of Clumps were first introduced after version <code>0x33000</code>. Versions <code>0x33000</code> and below do not have them.
  
  
== Structure ==
+
== Stream Format ==
  
All additional information for the clump section is stored in a ''struct section'' which is the first child section of the clump. It stores the following information:
+
The Clump's Struct has the following format:
  
  4b - DWORD  - Number of atomically linked objects, representing the number of [[Atomic_(RW_Section)|atomic sections]].
+
  4b - RwInt32 - Number of Atomics
  4b - DWORD  - Number of lights *
+
  4b - RwInt32 - Number of Lights - only present after version 0x33000
  4b - DWORD  - Number of cameras *
+
  4b - RwInt32 - Number of Cameras - only present after version 0x33000 but 0 in all GTA files
  
''* GTA does not support dynamic lights and multiple cameras so those values are zero by default.
+
Following the struct are a Frame List and a Geometry List.
 +
After that a number of Atomics as given by the atomic count.
 +
If the Clump has lights or cameras, next come pairs of Structs and Lights and Structs and Cameras respectively. In both cases the Struct contains a 4 byte index into the Frame List for the [[Frame (RW Section)|Frame]] the Light or Camera should be attached to.
  
== Child sections ==
+
Some DFFs deviate from the above structure. <code>loplyguy.dff</code> in GTA III (a version <code>0x30200</code> file) has no Geometry List. Instead the Geometries are children of their respective Atomic chunks (and consequently the Atomic Struct is 4 bytes shorter for having no geometry index).
 +
 
 +
== Child chunks ==
  
 
* [[Frame List (RW Section)|Frame List]]
 
* [[Frame List (RW Section)|Frame List]]
 
* [[Geometry List (RW Section)|Geometry List]]
 
* [[Geometry List (RW Section)|Geometry List]]
* [[Atomic (RW Section)|Frame List]] &ndash; Can be present multiple times depending on the number of objects (see ''Structure''.)
+
* [[Atomic (RW Section)|Atomic]]
 +
* [[Light (RW Section)|Light]]
 +
* [[Camera (RW Section)|Camera]]
  
 
== See also ==
 
== See also ==
 +
* [[RenderWare|RenderWare]]
 
* [[RenderWare_binary_stream_file|RW file format specification]]
 
* [[RenderWare_binary_stream_file|RW file format specification]]
 
* [[Texture Dictionary (RW Section)]]
 
* [[Texture Dictionary (RW Section)]]

Revision as of 07:22, 12 August 2015

{{{NAME}}}
RenderWare Stream Section
Vendor {{{VENDORNAME}}}
Module {{{MODULENAME}}}
Module ID 0x{{{MODULEID}}}
Identifier 0x{{{IDENTIFIER}}}
Chunk ID 0x{{{MODULEID}}}{{{IDENTIFIER}}}
Versions All
Hierarchy
Parents:
None
Children:
None
Extensions:
None
File Format

A Clump is a container for Frames, Atomics, Light and Cameras. In a binary stream a Clump's child chunks are a Struct (described below), a Frame List, a Geometry List, a number of Atomics, optionally a number of Structs and Lights and a number of Structs and Cameras (Cameras are unused in GTA). Mulitple Clumps may appear inside one .dff file. There is no counting variable stored inside the file defining how many Clumps are stored inside it.

Cameras and Lights as part of Clumps were first introduced after version 0x33000. Versions 0x33000 and below do not have them.


Stream Format

The Clump's Struct has the following format:

4b - RwInt32 - Number of Atomics
4b - RwInt32 - Number of Lights - only present after version 0x33000
4b - RwInt32 - Number of Cameras - only present after version 0x33000 but 0 in all GTA files

Following the struct are a Frame List and a Geometry List. After that a number of Atomics as given by the atomic count. If the Clump has lights or cameras, next come pairs of Structs and Lights and Structs and Cameras respectively. In both cases the Struct contains a 4 byte index into the Frame List for the Frame the Light or Camera should be attached to.

Some DFFs deviate from the above structure. loplyguy.dff in GTA III (a version 0x30200 file) has no Geometry List. Instead the Geometries are children of their respective Atomic chunks (and consequently the Atomic Struct is 4 bytes shorter for having no geometry index).

Child chunks

See also