Difference between revisions of "WPL"

From GTAMods Wiki
Jump to navigation Jump to search
(Section 15 - Unknown (Blok))
(Tools)
 
(19 intermediate revisions by 4 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 using [[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 ==
Line 8: Line 8:
 
   
 
   
 
  Size = 68 bytes
 
  Size = 68 bytes
  4b - UINT32 - (Main file header)         (Value always = 3)
+
  4b - UINT32   - (Version)   - value always "3"
  4b - UINT32 - (Section 0)  - Instances    (Value always = Amount of Object instances)
+
  4b - UINT32   - (Section 0)  - inst
  4b - UINT32 - (Section 1)  - Unused      (Value always = 0)
+
  4b - UINT32   - (Section 1)  - 0 (unused)
  4b - UINT32 - (Section 2)  - Garage      (Value always = Amount of Object instances)
+
  4b - UINT32   - (Section 2)  - grge
  4b - UINT32 - (Section 3)  - Parked Cars  (Value always = Amount of Object instances)(only used in * _stream *. wpl files)  
+
  4b - UINT32   - (Section 3)  - cars (only used in *_stream*.wpl)
  4b - UINT32 - (Section 4)  - Cull        (Value always = Amount of Object instances)
+
  4b - UINT32   - (Section 4)  - tcyc
  4b - UINT32 - (Section 5)  - Unused      (Value always = 0)
+
  4b - UINT32   - (Section 5)  - 0 (unused)
  4b - UINT32 - (Section 6)  - Unused      (Value always = 0)
+
  4b - UINT32   - (Section 6)  - 0 (unused)
  4b - UINT32 - (Section 7)  - Unused      (Value always = 0)
+
  4b - UINT32   - (Section 7)  - 0 (unused)
  4b - UINT32 - (Section 8)  - Strbig      (Value always = Amount of Object instances)(only used in * _strbig *. wpl files)  
+
  4b - UINT32   - (Section 8)  - mlop (only used in *_strbig*.wpl)
  4b - UINT32 - (Section 9)  - LODcull      (Value always = Amount of Object instances)(only used in lodcull_ *. wpl files)  
+
  4b - UINT32   - (Section 9)  - lodm (only used in lodcull_*.wpl)
  4b - UINT32 - (Section 10) - Zone or Cull (Value always = Amount of Object instances)
+
  4b - UINT32   - (Section 10) - slow
  4b - UINT32 - (Section 11) - Unused      (Value always = 0)
+
  4b - UINT32   - (Section 11) - 0 (unused)
  4b - UINT32 - (Section 12) - Unused      (Value always = 0)
+
  4b - UINT32   - (Section 12) - 0 (unused)
  4b - UINT32 - (Section 13) - Unused      (Value always = 0)
+
  4b - UINT32   - (Section 13) - 0 (unused)
  4b - UINT32 - (Section 14) - Unused      (Value always = 0)
+
  4b - UINT32   - (Section 14) - 0 (unused)
  4b - UINT32 - (Section 15) - Blok        (Value always = Amount of Object instances)
+
  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]]:
 
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]]:
Line 39: Line 39:
 
  4b - FLOAT  - Rotation W
 
  4b - FLOAT  - Rotation W
 
  4b - UINT32 - Model name [[:Category:Static_Model_Hashes|hash]]
 
  4b - UINT32 - Model name [[:Category:Static_Model_Hashes|hash]]
  4b - UINT32 - Unknown
+
  4b - UINT32 - Flags
 
  4b - INT32  - [[LOD]] Index  
 
  4b - INT32  - [[LOD]] Index  
 
  4b - UINT32 - Unknown
 
  4b - UINT32 - Unknown
Line 46: Line 46:
 
''Rotation information as [[Wikipedia:Quarternion|Quarternion]]''
 
''Rotation information as [[Wikipedia:Quarternion|Quarternion]]''
  
===Section 2 - Garages===
+
===Section 2 - GRGE(Garage)===
  
 
  Size = 48 bytes
 
  Size = 48 bytes
  4b - FLOAT   - Position X1
+
  4b - float   - X1
  4b - FLOAT   - Position Y1
+
  4b - float   - Y1
  4b - FLOAT   - Position Z1
+
  4b - float   - Z1
  4b - FLOAT   - Position X2
+
  4b - float   - frontX
  4b - FLOAT   - Position Y2
+
  4b - float   - frontY
  4b - FLOAT   - Position X3
+
  4b - float   - X2
  4b - FLOAT   - Position Y3
+
  4b - float   - Y2
  4b - FLOAT   - Position Z3
+
  4b - float   - Z2
  4b - UINT32  - DoorType
+
  4b - UINT32  - DoorType
  4b - UINT32  - GarageType
+
  4b - UINT32  - GarageType
  4b - UINT32  - hash
+
  8b - char    - GarageName
4b -  UINT32  - Unknown
+
 
 +
'''''X1, Y1, Z1''' = lower left vertex position''
 +
 
 +
'''''FrontX, FrontY''' = lower right front vertex position''
  
'''''X1, Y1, Z1''' = lower left vertex position, ''
+
'''''X2, Y2, Z2''' = upper left rear vertex position''
'''''X2, Y3, Z3''' = upper right vertex position, ''
 
'''''X3, Y2''' = lower left vertex position for Garage entrance''
 
  
===Section 3 - Parked Cars===
+
===Section 3 - CARS===
  
 
only used in the (*_stream*.wpl) files
 
only used in the (*_stream*.wpl) files
  
 
  Size = 56 bytes
 
  Size = 56 bytes
  4b - FLOAT  - Position X
+
  4b - float  - X
  4b - FLOAT  - Position Y
+
  4b - float  - Y
  4b - FLOAT  - Position Z
+
  4b - float  - Z
  4b - FLOAT  - Unknown
+
  4b - float  - Unknown
  4b - FLOAT  - Unknown
+
  4b - float  - Rotation
  4b - FLOAT  - Unknown
+
  4b - float  - Rotation
  4b - UINT32 - Model name [[:Category:Static_Model_Hashes|hash]]
+
  4b - UINT32 - Model name hash
  4b - INT32 - Unknown
+
  4b - int32  - Car color 1
  4b - INT32 - Unknown
+
  4b - int32  - Car color 2
  4b - INT32 - Unknown
+
4b - int32  - Car color 3
  4b - INT32 - Unknown
+
4b - int32  - Specular color
  4b - INT32 - Unknown
+
4b - UINT32  - Flags
  4b - INT32 - Unknown
+
4b - int32  - Alarm
  4b - INT32 - Unknown
+
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
  
===Section 4 - CULL===
+
'''''X1, Y1, Z1''' = lower left vertex position''
  
these are used for interiors directly accessed from outdoor locations.
+
'''''X2, Y2, Z2''' = upper left rear vertex position''
  
Size = 44 bytes
+
'''''Hash''' = Box hash name''
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 -  INT32  - Unknown
 
4b -  INT32  - Unknown
 
4b -  INT32  - Unknown
 
4b -  INT32  - Unknown
 
4b -  UINT32 - Model name [[:Category:Static_Model_Hashes|hash]]
 
  
'''''X1, Y1, Z1''' = lower left vertex position, ''
+
===Section 8 - MLOP===
'''''X2, Y2, Z2''' = upper right vertex position''
+
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
  
===Section 8 - Unknown (Strbig)===
+
'''''modelname''' = Model name''
  
only used in (*_strbig*.wpl) files.
+
'''''Pos X, Pos Y, Pos Z''' = Object coordinates''
  
Size = 44 bytes
+
'''''Rot X, Rot Y, Rot Z, Rot W''' = Object Rotate (In [[Wikipedia:Quarternion|Quarternion]] view)
24b - String - Model name
 
4b  - UINT32 - Unknown
 
4b  - UINT32 - Unknown
 
4b  - UINT32 - Unknown
 
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
 
  
===Section 9 - LODcull===
+
===Section 9 - LODM===
  
 
only used in (lodcull_x.wpl) files, usually located in 'Rockstar Games\Grand Theft Auto IV\pc\data\maps\generic' folder.
 
only used in (lodcull_x.wpl) files, usually located in 'Rockstar Games\Grand Theft Auto IV\pc\data\maps\generic' folder.
Line 156: Line 164:
 
  32b - String - Model name 10
 
  32b - String - Model name 10
  
'''''X1, Y1, Z1''' = lower left vertex position, ''
+
'''''X1, Y1, Z1''' = lower left vertex position''
 +
 
 
'''''X2, Y2, Z2''' = upper right vertex position''
 
'''''X2, Y2, Z2''' = upper right vertex position''
  
===Section 10 - Unknown (Zone 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
  
Size = 24 bytes
+
'''''X1, Y1, Z1''' = lower left vertex position''
4b - FLOAT - Position X1
 
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, ''
 
 
'''''X2, Y2, Z2''' = upper right vertex position''
 
'''''X2, Y2, Z2''' = upper right vertex position''
  
===Section 15 - Unknown (Blok)===
+
===Section 15 - BLOK===
 
+
Section is ignored by the game
 
  Size = 132 bytes  
 
  Size = 132 bytes  
 
  4b  - UINT32 - Unknown  
 
  4b  - UINT32 - Unknown  
Line 211: 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."-->
  
Line 219: Line 229:
 
* {{GTAG|6094|IV Placement Editor}} &ndash; by {{U|Chipsman}}
 
* {{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 224: 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