Difference between revisions of "WPL"

From GTAMods Wiki
Jump to navigation Jump to search
m (File Format)
(Tools)
 
(61 intermediate revisions by 6 users not shown)
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]].
+
'''WPL''' is the format of the map-related files in [[GTA4|GTA IV]] similar to [[Binary IPL|Binary IPLs]] introduced with [[GTA SA]]. It can be edited using [[WPL Manager]].
  
 
== File Format ==
 
== File Format ==
 +
 +
=== Binary Headers===
  
 
Each world placement file starts with one single header followed by the object placement information. The structure for the header is very simple:
 
Each world placement file starts with one single header followed by the object placement information. The structure for the header is very simple:
 +
 +
Size = 68 bytes
 +
4b - UINT32  - (Version)    - value always "3"
 +
4b - UINT32  - (Section 0)  - inst
 +
4b - UINT32  - (Section 1)  - 0 (unused)
 +
4b - UINT32  - (Section 2)  - grge
 +
4b - UINT32  - (Section 3)  - cars (only used in *_stream*.wpl)
 +
4b - UINT32  - (Section 4)  - tcyc
 +
4b - UINT32  - (Section 5)  - 0 (unused)
 +
4b - UINT32  - (Section 6)  - 0 (unused)
 +
4b - UINT32  - (Section 7)  - 0 (unused)
 +
4b - UINT32  - (Section 8)  - mlop (only used in *_strbig*.wpl)
 +
4b - UINT32  - (Section 9)  - lodm (only used in lodcull_*.wpl)
 +
4b - UINT32  - (Section 10) - slow
 +
4b - UINT32  - (Section 11) - 0 (unused)
 +
4b - UINT32  - (Section 12) - 0 (unused)
 +
4b - UINT32  - (Section 13) - 0 (unused)
 +
4b - UINT32  - (Section 14) - 0 (unused)
 +
4b - UINT32  - (Section 15) - blok (section ignore by the game)
 +
 +
The placement information corresponds to the previous [[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]]:
 +
 +
=== Section 0 - INST===
 +
 +
Size = 48 bytes
 +
4b - FLOAT  - Position X
 +
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 - Flags
 +
4b - INT32  - [[LOD]] Index
 +
4b - UINT32 - Unknown
 +
4b - FLOAT  - Unknown
 +
 +
''Rotation information as [[Wikipedia:Quarternion|Quarternion]]''
 +
 +
===Section 2 - GRGE(Garage)===
 +
 +
Size = 48 bytes
 +
4b - float  - X1
 +
4b - float  - Y1
 +
4b - float  - Z1
 +
4b - float  - frontX
 +
4b - float  - frontY
 +
4b - float  - X2
 +
4b - float  - Y2
 +
4b - float  - Z2
 +
4b - UINT32  - DoorType
 +
4b - UINT32  - GarageType
 +
8b - char    - GarageName
 +
 +
'''''X1, Y1, Z1''' = lower left vertex position''
 +
 +
'''''FrontX, FrontY''' = lower right front vertex position''
 +
 +
'''''X2, Y2, Z2''' = upper left rear vertex position''
 +
 +
===Section 3 - CARS===
 +
 +
only used in the (*_stream*.wpl) files
 +
 +
Size = 56 bytes
 +
4b - float  - X
 +
4b - float  - Y
 +
4b - float  - Z
 +
4b - float  - Unknown
 +
4b - float  - Rotation
 +
4b - float  - Rotation
 +
4b - UINT32  - Model name hash
 +
4b - int32  - Car color 1
 +
4b - int32  - Car color 2
 +
4b - int32  - Car color 3
 +
4b - int32  - Specular color
 +
4b - UINT32  - Flags
 +
4b - int32  - Alarm
 +
4b - int32  - Unknown
 +
  
4b - UINT32  - Unknown
+
===Section 4 - TCYC===
4b - UINT32  - Instances
 
  
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]]:
+
Size = 56 bytes
 +
4b - float  - X1
 +
4b - float  - Y1
 +
4b - float  - Z1
 +
4b - float  - X2
 +
4b - float  - Y2
 +
4b - float  - Z2
 +
4b - UINT32  - Unknown1
 +
4b - UINT32  - Unknown2
 +
4b - UINT32  - Unknown3
 +
4b - UINT32  - Unknown4
 +
4b - UINT32  - Hash
  
''' Section 0 - INST'''  
+
'''''X1, Y1, Z1''' = lower left vertex position''  
  
4b - FLOAT  - Position X
+
'''''X2, Y2, Z2''' = upper left rear vertex position''
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)(Line entry number of LOD model)
 
4b - UINT32  - Unknown
 
4b - UINT32  - Unknown
 
  
''Rotation information as [[Wikipedia:Quarternion|Quarternion]]''
+
'''''Hash''' = Box hash name''
 +
 
 +
===Section 8 - MLOP===
 +
Used only in (*_strbig*.wpl) files.
 +
 +
size = 64 bytes
 +
24b - char    - modelname
 +
4b  - UINT32  - flags
 +
4b  - UINT32  - interior index // interior inst index
 +
4b  - UINT32  - Unknown
 +
4b  - float  - Pos X
 +
4b  - float  - Pos Y
 +
4b  - float  - Pos Z
 +
4b  - float  - Rot X
 +
4b  - float  - Rot Y
 +
4b  - float  - Rot Z
 +
4b  - float  - Rot W
 +
 
 +
'''''modelname''' = Model name''
 +
 
 +
'''''Pos X, Pos Y, Pos Z''' = Object coordinates''
 +
 
 +
'''''Rot X, Rot Y, Rot Z, Rot W''' = Object Rotate (In [[Wikipedia:Quarternion|Quarternion]] view)
  
'''Section 3 - Parked Cars'''
+
===Section 9 - LODM===
  
4b - FLOAT  - Position X
+
only used in (lodcull_x.wpl) files, usually located in 'Rockstar Games\Grand Theft Auto IV\pc\data\maps\generic' folder.
4b - FLOAT  - Position Y
 
4b - FLOAT  - Position Z
 
4b - FLOAT  - Unknown
 
4b - FLOAT  - Unknown
 
4b - FLOAT  - Unknown
 
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'''
+
Size = 388 bytes
 +
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 - [[:Category:Static_Model_Hashes|Hash]] 1
 +
4b  - UINT32 - [[:Category:Static_Model_Hashes|Hash]] 2
 +
4b  - UINT32 - [[:Category:Static_Model_Hashes|Hash]] 3
 +
4b  - UINT32 - [[:Category:Static_Model_Hashes|Hash]] 4
 +
4b  - UINT32 - [[:Category:Static_Model_Hashes|Hash]] 5
 +
4b  - UINT32 - [[:Category:Static_Model_Hashes|Hash]] 6
 +
4b  - UINT32 - [[:Category:Static_Model_Hashes|Hash]] 7
 +
4b  - UINT32 - [[:Category:Static_Model_Hashes|Hash]] 8
 +
4b  - UINT32 - [[:Category:Static_Model_Hashes|Hash]] 9
 +
4b  - UINT32 - [[:Category:Static_Model_Hashes|Hash]] 10
 +
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
  
4b -  FLOAT  - Position X1
+
'''''X1, Y1, Z1''' = lower left vertex position''
4b -  FLOAT  - Position Y1
 
4b -  FLOAT  - Position Z1
 
4b -  FLOAT  - Position X2
 
4b -  FLOAT  - Position Y2
 
4b -  FLOAT  - Position Z2
 
4b  - UINT32  - Number of Lod models in wdd file (upto a maximum of 10)
 
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''
 
'''''X2, Y2, Z2''' = upper right vertex position''
  
'''Section 10 - Unknown Zon or Cull'''
+
===Section 10 - SLOW===
 +
 +
Size = 24 bytes
 +
4b - float    - X1
 +
4b - float    - Y1
 +
4b - float    - Z1
 +
4b - float    - X2
 +
4b - float    - Y2
 +
4b - float    - Z2
  
4b - FLOAT    - Position X1
+
'''''X1, Y1, Z1''' = lower left vertex position''
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''
 
'''''X2, Y2, Z2''' = upper right vertex position''
 +
 +
===Section 15 - BLOK===
 +
Section is ignored by the game
 +
Size = 132 bytes
 +
4b  - UINT32 - Unknown
 +
92b - Char  - Unknown string (X1,Y1,X2,Y2,X3,Y3,X4,Y4)
 +
4b  - UINT32 - Unknown
 +
4b  - FLOAT  - X1
 +
4b  - FLOAT  - Y1
 +
4b  - FLOAT  - X1
 +
4b  - FLOAT  - Y2
 +
4b  - FLOAT  - X3
 +
4b  - FLOAT  - Y3
 +
4b  - FLOAT  - X4
 +
4b  - FLOAT  - Y4
  
 
<!---
 
<!---
Line 113: Line 221:
 
-->
 
-->
  
== XPL ==
+
== XPL and CPL ==
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]].
+
In the XBox 360's version of GTA 4 same files have the extension <code>.xpl</code>, PS3 version have the extension <code>.cpl</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]]. .xpl and .cpl files are identical in structure.
 
<!--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."-->
 
<!--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 ==
 
== Tools ==
 +
* {{GTAF|409799|GTA IV Placement Tool}} &ndash; by |Dageron|
 +
* {{GTAG|6094|IV Placement Editor}} &ndash; by {{U|Chipsman}}
 
* [[WPL Manager]] &ndash; by {{U|UZI-I|Yoann (UZI-I)}}
 
* [[WPL Manager]] &ndash; by {{U|UZI-I|Yoann (UZI-I)}}
 +
* [[OpenIV]] &ndash; contains a built-in WPL viewer
 +
* [[Ingame WPL Editor]] &ndash; edit/export WPL files
 +
 +
== See also ==
 +
* [[Binary IPL]] &ndash; binary item placecement file format from ''GTA San Andreas''.
 +
* [[IPL]] &ndash; plain text item placement format used for all games of the ''GTA III triology'' and ''GTA IV''.
  
 
== External Link ==
 
== External Link ==
Line 124: Line 240:
  
 
{{GTA4-navi}}
 
{{GTA4-navi}}
{{File-stub}}
+
[[Category:Map Formats]]
[[Category:Map Formats]][[Category:GTA 4]]
 

Latest revision as of 17:32, 3 May 2016

WPL is the format of the map-related files in GTA IV similar to Binary IPLs introduced with GTA SA. It can be edited using WPL Manager.

File Format

Binary Headers

Each world placement file starts with one single header followed by the object placement information. The structure for the header is very simple:

Size = 68 bytes
4b - UINT32   - (Version)    - value always "3"
4b - UINT32   - (Section 0)  - inst
4b - UINT32   - (Section 1)  - 0 (unused)
4b - UINT32   - (Section 2)  - grge
4b - UINT32   - (Section 3)  - cars (only used in *_stream*.wpl)
4b - UINT32   - (Section 4)  - tcyc 
4b - UINT32   - (Section 5)  - 0 (unused)
4b - UINT32   - (Section 6)  - 0 (unused)
4b - UINT32   - (Section 7)  - 0 (unused)
4b - UINT32   - (Section 8)  - mlop (only used in *_strbig*.wpl)
4b - UINT32   - (Section 9)  - lodm (only used in lodcull_*.wpl)
4b - UINT32   - (Section 10) - slow
4b - UINT32   - (Section 11) - 0 (unused)
4b - UINT32   - (Section 12) - 0 (unused)
4b - UINT32   - (Section 13) - 0 (unused)
4b - UINT32   - (Section 14) - 0 (unused)
4b - UINT32   - (Section 15) - blok (section ignore by the game)

The placement information corresponds to the previous instance section of the .ipl files. They have a binary structure like the binary ipl files introduced with San Andreas:

Section 0 - INST

Size = 48 bytes
4b - FLOAT  - Position X
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 hash
4b - UINT32 - Flags
4b - INT32  - LOD Index 
4b - UINT32 - Unknown
4b - FLOAT  - Unknown

Rotation information as Quarternion

Section 2 - GRGE(Garage)

Size = 48 bytes
4b - float   - X1
4b - float   - Y1
4b - float   - Z1
4b - float   - frontX
4b - float   - frontY
4b - float   - X2
4b - float   - Y2
4b - float   - Z2
4b - UINT32  - DoorType
4b - UINT32  - GarageType
8b - char    - GarageName

X1, Y1, Z1 = lower left vertex position

FrontX, FrontY = lower right front vertex position

X2, Y2, Z2 = upper left rear vertex position

Section 3 - CARS

only used in the (*_stream*.wpl) files

Size = 56 bytes
4b - float   - X
4b - float   - Y
4b - float   - Z
4b - float   - Unknown
4b - float   - Rotation
4b - float   - Rotation
4b - UINT32  - Model name hash
4b - int32   - Car color 1
4b - int32   - Car color 2
4b - int32   - Car color 3
4b - int32   - Specular color
4b - UINT32  - Flags
4b - int32   - Alarm
4b - int32   - Unknown


Section 4 - TCYC

Size = 56 bytes
4b - float   - X1
4b - float   - Y1
4b - float   - Z1
4b - float   - X2
4b - float   - Y2
4b - float   - Z2
4b - UINT32  - Unknown1
4b - UINT32  - Unknown2
4b - UINT32  - Unknown3
4b - UINT32  - Unknown4
4b - UINT32  - Hash

X1, Y1, Z1 = lower left vertex position

X2, Y2, Z2 = upper left rear vertex position

Hash = Box hash name

Section 8 - MLOP

Used only in (*_strbig*.wpl) files.

size = 64 bytes
24b - char    - modelname
4b  - UINT32  - flags
4b  - UINT32  - interior index // interior inst index
4b  - UINT32  - Unknown
4b  - float   - Pos X
4b  - float   - Pos Y
4b  - float   - Pos Z
4b  - float   - Rot X
4b  - float   - Rot Y
4b  - float   - Rot Z
4b  - float   - Rot W

modelname = Model name

Pos X, Pos Y, Pos Z = Object coordinates

Rot X, Rot Y, Rot Z, Rot W = Object Rotate (In Quarternion view)

Section 9 - LODM

only used in (lodcull_x.wpl) files, usually located in 'Rockstar Games\Grand Theft Auto IV\pc\data\maps\generic' folder.

Size = 388 bytes
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
4b  - UINT32 - Hash 2
4b  - UINT32 - Hash 3
4b  - UINT32 - Hash 4
4b  - UINT32 - Hash 5
4b  - UINT32 - Hash 6
4b  - UINT32 - Hash 7
4b  - UINT32 - Hash 8
4b  - UINT32 - Hash 9
4b  - UINT32 - Hash 10
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

X2, Y2, Z2 = upper right vertex position

Section 10 - SLOW

Size = 24 bytes
4b - float     - X1
4b - float     - Y1
4b - float     - Z1
4b - float     - X2
4b - float     - Y2
4b - float     - Z2

X1, Y1, Z1 = lower left vertex position

X2, Y2, Z2 = upper right vertex position

Section 15 - BLOK

Section is ignored by the game

Size = 132 bytes 
4b  - UINT32 - Unknown 
92b - Char   - Unknown string (X1,Y1,X2,Y2,X3,Y3,X4,Y4)
4b  - UINT32 - Unknown 
4b  - FLOAT  - X1 
4b  - FLOAT  - Y1 
4b  - FLOAT  - X1 
4b  - FLOAT  - Y2 
4b  - FLOAT  - X3 
4b  - FLOAT  - Y3 
4b  - FLOAT  - X4 
4b  - FLOAT  - Y4 


XPL and CPL

In the XBox 360's version of GTA 4 same files have the extension .xpl, PS3 version have the extension .cpl. 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 big-endian order. .xpl and .cpl files are identical in structure.

Tools

See also

  • Binary IPL – binary item placecement file format from GTA San Andreas.
  • IPL – plain text item placement format used for all games of the GTA III triology and GTA IV.

External Link