Difference between revisions of "WPL"

From GTAMods Wiki
Jump to navigation Jump to search
Line 1: Line 1:
{{File-stub}}
 
 
'''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]].
 
'''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]].
  
Line 9: 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   - (?????? 0)  - inst
  4b - UINT32 - (Section 1)  - Unused      (Value always = 0)
+
  4b - UINT32   - (?????? 1)  - 0 (unused)
  4b - UINT32 - (Section 2)  - Garage      (Value always = Amount of Object instances)
+
  4b - UINT32   - (?????? 2)  - grge
  4b - UINT32 - (Section 3)  - Parked Cars  (Value always = Amount of Object instances)(only used in * _stream *. wpl files)  
+
  4b - UINT32   - (?????? 3)  - cars (only used in *_stream*.wpl)
  4b - UINT32 - (Section 4)  - Cull        (Value always = Amount of Object instances)
+
  4b - UINT32   - (?????? 4)  - tcyc
  4b - UINT32 - (Section 5)  - Unused      (Value always = 0)
+
  4b - UINT32   - (?????? 5)  - 0 (unused)
  4b - UINT32 - (Section 6)  - Unused      (Value always = 0)
+
  4b - UINT32   - (?????? 6)  - 0 (unused)
  4b - UINT32 - (Section 7)  - Unused      (Value always = 0)
+
  4b - UINT32   - (?????? 7)  - 0 (unused)
  4b - UINT32 - (Section 8)  - Strbig      (Value always = Amount of Object instances)(only used in * _strbig *. wpl files)  
+
  4b - UINT32   - (?????? 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   - (?????? 9)  - lodm (only used in lodcull_*.wpl)
  4b - UINT32 - (Section 10) - Zone or Cull (Value always = Amount of Object instances)
+
  4b - UINT32   - (?????? 10) - slow
  4b - UINT32 - (Section 11) - Unused      (Value always = 0)
+
  4b - UINT32   - (?????? 11) - 0 (unused)
  4b - UINT32 - (Section 12) - Unused      (Value always = 0)
+
  4b - UINT32   - (?????? 12) - 0 (unused)
  4b - UINT32 - (Section 13) - Unused      (Value always = 0)
+
  4b - UINT32   - (?????? 13) - 0 (unused)
  4b - UINT32 - (Section 14) - Unused      (Value always = 0)
+
  4b - UINT32   - (?????? 14) - 0 (unused)
  4b - UINT32 - (Section 15) - Blok        (Value always = Amount of Object instances)
+
  4b - UINT32   - (?????? 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 40: 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 50: Line 49:
  
 
  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 - Rotation Z from -10 to 10
+
  4b - float  - Unknown
  4b - FLOAT - Rotation ?
+
  4b - float  - Rotation
  4b - FLOAT - Rotation ?
+
  4b - float  - Rotation
  4b - UINT32 - Model Name Hash [[List_of_models_hashes#Vehicles|Hashes list]]
+
4b - UINT32  - Model name hash
  4b - INT32 - Unknown Always -1
+
  4b - int32  - Car color 1
  4b - INT32 - Unknown Always -1
+
  4b - int32  - Car color 2
  4b - INT32 - Unknown Always -1
+
  4b - int32  - Car color 3
  4b - INT32 - Unknown Always -1
+
  4b - int32  - Specular color
  4b - INT32 - Car groups hash ( this selects car group only used when value 7 is 0 this will then spawn any car from this group ) [http://img848.imageshack.us/img848/4885/hashes.jpg]
+
  4b - UINT32 - Flags
  4b - INT32 - Unknown Always 0
+
  4b - int32  - Alarm
  4b - INT32 - Unknown Always 0
+
  4b - int32  - Unknown
 +
 
 +
 
 +
===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 157: 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  

Revision as of 15:40, 22 January 2012

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   - (?????? 0)  - inst
4b - UINT32   - (?????? 1)  - 0 (unused)
4b - UINT32   - (?????? 2)  - grge
4b - UINT32   - (?????? 3)  - cars (only used in *_stream*.wpl)
4b - UINT32   - (?????? 4)  - tcyc 
4b - UINT32   - (?????? 5)  - 0 (unused)
4b - UINT32   - (?????? 6)  - 0 (unused)
4b - UINT32   - (?????? 7)  - 0 (unused)
4b - UINT32   - (?????? 8)  - mlop (only used in *_strbig*.wpl)
4b - UINT32   - (?????? 9)  - lodm (only used in lodcull_*.wpl)
4b - UINT32   - (?????? 10) - slow
4b - UINT32   - (?????? 11) - 0 (unused)
4b - UINT32   - (?????? 12) - 0 (unused)
4b - UINT32   - (?????? 13) - 0 (unused)
4b - UINT32   - (?????? 14) - 0 (unused)
4b - UINT32   - (?????? 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 - Garages

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


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

In the XBox 360's version of GTA 4 same files have the extension .xpl. 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.

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