Difference between revisions of "Binary IPL"

From GTAMods Wiki
Jump to navigation Jump to search
(File Format)
Line 1: Line 1:
'''WPL''' is the format of the map-related files similar to [[IPL]]s from the previous games. It can be edited with [[WPL Manager]].
+
'''Binary [[IPL|item placement]]''' files are only present in [[San Andreas]] and can be only opened or edited using a special editor. Binary item placement files are also present in [[GTA IV]], where they are called [[WPL]] files and have another format.
  
 
== File Format ==
 
== File Format ==
  
Each world placement file starts with one single header followed by the object placement information. The structure for the header is very simple:
+
Each binary item placement file starts with a 4 byte identifier, followed by a short header which contains the number of instances in a block. All in all a binary ipl file has the same format as an uncompiled one, just with the difference that the information is stored binary instead as plain text.
  
  4b - UINT32   - Unknown
+
  4b - CHAR[4]   - always 'bnry'
  4b - UINT32  - Instances
+
4b  - INT32    - number of item instances
 +
  4b - INT32    - number of unknown 1
 +
4b  - INT32    - number of unknown 2
 +
4b  - INT32    - number of unknown 3
 +
4b  - INT32    - number of parked cars
 +
4b  - INT32    - number of unknown 4
 +
4b  - INT32    - offset of item instances (should be 76)
 +
4b  - INT32    - unused size (always 0)
 +
4b  - INT32    - offset of unknown 1
 +
4b  - INT32    - unused size (always 0)
 +
4b  - INT32    - offset of unknown 2
 +
4b  - INT32    - unused size (always 0)
 +
4b  - INT32    - offset of unknown 3
 +
4b  - INT32    - unused size (always 0)
 +
4b  - INT32    - offset of parked cars
 +
4b  - INT32    - unused size (always 0)
 +
4b  - INT32    - offset of unknown 4
 +
4b  - INT32    - unused size (always 0)
  
The placement information corresponds to the previous [[Item_Placement#inst|instance]] section of the <code>.ipl</code> files. They have a binary structure like the [[Binary_IPL|binary ipl]] files introduced with [[San Andreas]]:
+
However there are only [[INST]] and [[CARS]] sections are used in binary IPL's, so the rest of the format is unknown.
  
''' Section 0 - INST'''  
+
The header is followed by the arrays of the objects. INST arrays do have a size of '''40 bytes''' per structure, and cars got '''48 bytes'''.
  
4b - FLOAT  - Position X
+
===INST Structure===
4b - FLOAT  - Position Y
 
4b - FLOAT  - Position Z
 
4b - FLOAT  - Rotation X
 
4b - FLOAT  - Rotation Y
 
4b - FLOAT  - Rotation Z
 
4b - FLOAT  - Rotation W
 
4b - UINT32  - Model name [[:Category:Static_Model_Hashes|hash]]
 
4b - UINT32  - Unknown
 
4b - UINT32  - [[LOD]] Index (Index of another model in the current file)
 
4b - UINT32  - Unknown
 
4b - UINT32  - Unknown
 
  
 +
4b  - FLOAT    - PosX
 +
4b  - FLOAT    - PosY
 +
4b  - FLOAT    - PosZ
 +
4b  - FLOAT    - RotX
 +
4b  - FLOAT    - RotY
 +
4b  - FLOAT    - RotZ
 +
4b  - FLOAT    - RotW
 +
4b  - INT32    - Object ID
 +
4b  - UINT32  - [[IDE#Object_Flags|Flags]]
 +
 +
<!-- Are those flags realy IDE flags? This appears very strange, so you can assign different flags to one item, which goes against the internal core rule, that flags are controlled by the IDE pool and applied to the rendering engine using the object id... straaaange ^^ - Got to check this! -->
 
''Rotation information as [[Wikipedia:Quarternion|Quarternion]]''
 
''Rotation information as [[Wikipedia:Quarternion|Quarternion]]''
  
'''Section 3 - Parked Cars'''
+
===CARS Structure===
  
  4b - FLOAT  - Position X
+
  4b  - FLOAT   - PosX
  4b - FLOAT   - Position Y
+
  4b  - FLOAT   - PosY
  4b - FLOAT  - Position Z
+
  4b  - FLOAT   - PosZ
  4b - FLOAT   - Unknown
+
  4b  - FLOAT    - Angle (Around Z-Axis)
  4b - FLOAT  - Unknown
+
  4b  - INT32   - Object ID
  4b - FLOAT   - Unknown
+
  28b - INT32[7] - Unknown flags (See [[Item_Placement#CARS|IPL file specification]])
  4b - UINT32 - Model name [[:Category:Static_Model_Hashes|hash]]
 
4b - INT32  - Unknown
 
4b - INT32  - Unknown
 
  4b - INT32  - Unknown
 
  4b - INT32   - Unknown
 
  4b - INT32   - Unknown
 
4b - INT32  - Unknown
 
4b - INT32  - Unknown
 
  
'''Section 9 - LODcull'''
+
== Tools ==
 
+
* [http://www.gta.ocram-net.de/index_all.php?downloadsa=11 Binary (De-)Compiler] - by {{U|ocram88}}
4b -  FLOAT  - Position X1
 
4b -  FLOAT  - Position Y1
 
4b -  FLOAT  - Position Z1
 
4b -  FLOAT  - Position X2
 
4b -  FLOAT  - Position Y2
 
4b -  FLOAT  - Position Z2
 
4b  - UINT32  - Unknown UINT32
 
4b  - UINT32  - Hash 1  - [[:Category:Static_Model_Hashes|hash]]
 
4b  - UINT32  - Hash 2  - [[:Category:Static_Model_Hashes|hash]]
 
4b  - UINT32  - Hash 3  - [[:Category:Static_Model_Hashes|hash]]
 
4b  - UINT32  - Hash 4  - [[:Category:Static_Model_Hashes|hash]]
 
4b  - UINT32  - Hash 5  - [[:Category:Static_Model_Hashes|hash]]
 
4b  - UINT32  - Hash 6  - [[:Category:Static_Model_Hashes|hash]]
 
4b  - UINT32  - Hash 7  - [[:Category:Static_Model_Hashes|hash]]
 
4b  - UINT32  - Hash 8  - [[:Category:Static_Model_Hashes|hash]]
 
4b  - UINT32  - Hash 9  - [[:Category:Static_Model_Hashes|hash]]
 
4b  - UINT32  - Hash 10 - [[:Category:Static_Model_Hashes|hash]]
 
32b - String  - Model name 1
 
32b - String  - Model name 2
 
32b - String  - Model name 3
 
32b - String  - Model name 4
 
32b - String  - Model name 5
 
32b - String  - Model name 6
 
32b - String  - Model name 7
 
32b - String  - Model name 8
 
32b - String  - Model name 9
 
32b - String  - Model name 10
 
 
 
'''''X1, Y1, Z1''' = lower left vertex position'' and
 
'''''X2, Y2, Z2''' = upper right vertex position''
 
  
'''Section 10 - Unknown Zon or Cull'''
+
== See also ==
 
+
* [[INST]]
4b - FLOAT    - Position X1
+
* [[CARS (IPL Section)]]
4b - FLOAT    - Position Y1
 
4b - FLOAT    - Position Z1
 
4b - FLOAT    - Position X2
 
4b - FLOAT    - Position Y2
 
4b - FLOAT    - Position Z2
 
 
 
'''''X1, Y1, Z1''' = lower left vertex position'' and
 
'''''X2, Y2, Z2''' = upper right vertex position''
 
 
 
<!---
 
;Header
 
<source lang="cpp">
 
struct Header_t
 
{
 
    BYTE byteUnknown01[4];
 
    DWORD dwNbrOfBlockInst;
 
};
 
</source>
 
 
 
;InstBlock (Start from 0x44)
 
<source lang="cpp">
 
struct Inst_t
 
{
 
    float  fPosition[3];
 
    float  fRotation[4];
 
    DWORD dwModelNameHash;
 
    BYTE byteUnknown01[4];
 
    DWORD dwAttachedLod;
 
    BYTE byteUnknown02[8];
 
};
 
</source>
 
-->
 
 
 
== XPL ==
 
In the XBox 360's version of GTA 4 same files have the extension <code>.xpl</code>. The XPL and WPL formats  are same, but due to the fact XPL files are used on the Xenon platform its data is stored in the [[Wikipedia:Endianness|big-endian order]].
 
<!--not sure where to put this: "They are used to map generic objects which are defined with another path in the [[Images.txt|image listing]] file."-->
 
 
 
== Tools ==
 
* [[WPL Manager]] &ndash; by {{U|UZI-I|Yoann (UZI-I)}}
 
  
== External Link ==
+
== External Links ==
* {{GTAF|389423|WPL file format specification}}
+
* {{GTAF|202532|IPL documentation}} &ndash; by {{U|spaceeinstein}}
 +
* [http://people.freenet.de/steve-m/binipl.rar Binary IPL's decompiled] - by {{U|steve-m}}
  
{{GTA4-navi}}
+
{{file-stub}}
{{File-stub}}
+
{{SA-navi}}
[[Category:Map Formats]][[Category:GTA 4]]
+
[[Category:Map_Formats]]

Revision as of 13:29, 25 July 2009

Binary item placement files are only present in San Andreas and can be only opened or edited using a special editor. Binary item placement files are also present in GTA IV, where they are called WPL files and have another format.

File Format

Each binary item placement file starts with a 4 byte identifier, followed by a short header which contains the number of instances in a block. All in all a binary ipl file has the same format as an uncompiled one, just with the difference that the information is stored binary instead as plain text.

4b  - CHAR[4]   - always 'bnry'
4b  - INT32     - number of item instances
4b  - INT32     - number of unknown 1
4b  - INT32     - number of unknown 2
4b  - INT32     - number of unknown 3
4b  - INT32     - number of parked cars
4b  - INT32     - number of unknown 4
4b  - INT32     - offset of item instances (should be 76)
4b  - INT32     - unused size (always 0)
4b  - INT32     - offset of unknown 1
4b  - INT32     - unused size (always 0)
4b  - INT32     - offset of unknown 2
4b  - INT32     - unused size (always 0)
4b  - INT32     - offset of unknown 3
4b  - INT32     - unused size (always 0)
4b  - INT32     - offset of parked cars
4b  - INT32     - unused size (always 0)
4b  - INT32     - offset of unknown 4
4b  - INT32     - unused size (always 0)

However there are only INST and CARS sections are used in binary IPL's, so the rest of the format is unknown.

The header is followed by the arrays of the objects. INST arrays do have a size of 40 bytes per structure, and cars got 48 bytes.

INST Structure

4b  - FLOAT    - PosX
4b  - FLOAT    - PosY
4b  - FLOAT    - PosZ
4b  - FLOAT    - RotX
4b  - FLOAT    - RotY
4b  - FLOAT    - RotZ
4b  - FLOAT    - RotW
4b  - INT32    - Object ID
4b  - UINT32   - Flags

Rotation information as Quarternion

CARS Structure

4b  - FLOAT    - PosX
4b  - FLOAT    - PosY
4b  - FLOAT    - PosZ
4b  - FLOAT    - Angle (Around Z-Axis)
4b  - INT32    - Object ID
28b - INT32[7] - Unknown flags (See IPL file specification)

Tools

See also

External Links