Difference between revisions of "Binary IPL"

From GTAMods Wiki
Jump to navigation Jump to search
Line 1: Line 1:
Binary [[IPL|Item Placement]] files are only present in [[Category:GTA_SA|San Andreas]] and can be only opened or edited using a special editor.
+
Binary [[IPL|item placement]] files are only present in [[Category:GTA_SA|San Andreas]] and can be only opened or edited using a special editor.
  
<!-- To be filled in... -->
+
==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 [[Item_Placement#INST|INST]] and [[Item_Placement#CARS|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  - [[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]]''
 +
 
 +
====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 [[Item_Placement#CARS|IPL file specification]])
  
 
===Tools===
 
===Tools===

Revision as of 21:41, 22 January 2009

Binary item placement files are only present in and can be only opened or edited using a special editor.

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

External Links