WPL

From GTAMods Wiki
(Redirected from World Placement)
Jump to navigation Jump to search

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