Difference between revisions of "Item Placement"

From GTAMods Wiki
Jump to navigation Jump to search
m (Messed up some of the code I added (d'oh!) so I fixed it.)
m
 
(96 intermediate revisions by 13 users not shown)
Line 1: Line 1:
==Introduction==
+
{{IplSection
'''I'''tem '''PL'''acement files are used to place objects into gta world, this includes objects, zones and paths.
+
| noheader=1
 +
}}
 +
'''Item placement''' files, usually identified by the file extension <code>.ipl</code>, are a part of the [[map system]] and used to create and place (for example) different objects, zones of special behavior or paths in the world. All games support standard item placement files which are mostly stored in plain text format that can be opened and edited using any text-editing program (like [[Wikipedia:Notepad|Notepad]]), but there are tools to simplify editing of the newly introduced Binary Ipl in [[GTA SA|San Andreas]]. Most of the placement information in [[GTA IV]] is stored inside of binary files (see [[WPL]]).
  
==Structure==
+
== Text Format ==
The .ipl files are split up into many sections. How many of them you use in your file is optional, they can even be empty. Each section starts with a section identifier and ends with the keyword "end", both in a single line.
 
  
Example:
+
The structure and format of the plain text item placement files are similar to that of the [[item definition]] files. The game searches for these files in [[Gta.dat|gta.dat]].They allow comments by the character <code>#</code>.Lines starting with this character simply get ignored by the game & empty lines are also allowed. Since these files contain different types of data a keyword is required for the game to recognize each set of data.
  inst
+
  <keyword>
 +
  *lines*
 +
  end
 +
More information about these keywords can be found below in the <code>Fomats</code> section.
 +
 
 +
:''See also: [[Item Definition#Overview|Item Definition &sect; Overview]]''
 +
 
 +
 
 +
== Binary Format ==
 +
 
 +
''San Andreas'' introduced a simple binary format of item placement files. They are stored as ''"streaming files"'' inside the [[IMG|archive files]]. Editing them requires an special editor (see [[IPL#Tools|below]]). The format is pretty simple and their possibilities are not completely used by ''Rockstar''. By default they do only support <code>inst</code> and <code>cars</code> sections. It is unconfirmed if other sections also can be used or if they are just stubs which are not implemented. Anyway, their binary format is completely unknown.
 +
 
 +
{{Incomplete}}
 +
<!--- How do binary IPLs get recognized by the game? --->
 +
 
 +
==== Header ====
 +
 
 +
Each binary placement information file starts with a 4-Byte identifier followed by a header containing information about the content of the files.
 +
 
 +
4b  - CHAR[4]  - Always "bnry"
 +
4b  - INT32    - Number of [[INST|item instances]]
 +
4b  - INT32    - Number of unknown 1 (''CULL'' ?)
 +
4b  - INT32    - Number of unknown 2 (''GRGE'' ?)
 +
4b  - INT32    - Number of unknown 3 (''ENEX'' ?)
 +
4b  - INT32    - Number of [[CARS|parked cars]]
 +
4b  - INT32    - Number of unknown 4 (''PICK'' ?)
 +
4b  - INT32    - Offset of item instances (0x4C by default)
 +
4b  - INT32    - Size of item instances (unused - always 0)
 +
4b  - INT32    - Offset of unknown 1
 +
4b  - INT32    - Size of unknown 1 (unused - always 0)
 +
4b  - INT32    - Offset of unknown 2
 +
4b  - INT32    - Size of unknown 2 (unused - always 0)
 +
4b  - INT32    - Offset of unknown 3
 +
4b  - INT32    - Size of unknown 3 (unused - always 0)
 +
4b  - INT32    - Offset of parked cars
 +
4b  - INT32    - Size of parked cars (unused - always 0)
 +
4b  - INT32    - Offset of unknown 4
 +
4b  - INT32    - Size of unknown 4 (unused - always 0)
 +
 
 +
The header is followed by the arrays of the entries.INST arrays have a size of 40 bytes per structure, and cars have 48 bytes.
 +
 
 +
=== INST ===
 +
 
 +
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  - INT32    - Object ID (as an index to the ''IDE'')
 +
4b  - INT32    - Interior
 +
4b  - INT32    - ''LOD'' index
 +
 
 +
=== CARS ===
 +
''CARS'' is one of the known sections which can be used in binary format inside streaming files. It's format is similar to the plain text format:  
 +
 
 +
4b  - FLOAT    - Position X
 +
4b  - FLOAT    - Position Y
 +
4b  - FLOAT    - Position Z
 +
  4b  - FLOAT    - Angle (Around Z-Axis)
 +
4b  - INT32    - Object ID (an index to an [[CARS_(IDE_Section)|vehicle definition]])
 +
4b  - INT32    - Primary color
 +
4b  - INT32    - Secondary color
 +
4b  - INT32    - Force spawn (Windows BOOL - see ''<code>WinDef.h</code>'')
 +
4b  - INT32    - Alarm probability
 +
4b  - INT32    - Locked probability
 +
4b  - INT32    - Unknown1 (Could be tertiary color)
 +
4b  - INT32    - Unknown2 (Could be quarterdeck color)
 +
 
 +
'''Load a custom file'''
 +
 
 +
A basic comparison between a normal <code>.ipl</code> and a binary <code>.ipl</code>.
 +
 
 +
'''Normal:'''
 +
15072, PLS_carpark, 0, 2579.8796445, 645.50208432, 9.93, 0, 0, 0, 1, -1
 +
 
 +
'''Binary:'''
 +
15072, dummy, 0, 2579.8796445, 645.50208432, 9.93, 0, 0, 0, 1, -1
 +
 
 +
The object name is basically ignored in <code>.ipl</code>
 +
 
 +
Now for converting a text <code>.ipl</code> to binary <code>.ipl</code> and vice-versa,we can use [https://gtaforums.com/topic/857375-fastman92-processor/ fastman92-processor].Its a pretty simple program we can get most of the work done by editing the <code>fastman92_processor.bat</code>(Or can use Binary (De-)Compiler).
 +
 
 +
After converting to binary form we have to create a normal <code>.ipl</code> file and index it in [[Gta.dat]].Lets suppose the name of our <code>.ipl</code> is
 +
 
 +
test.ipl
 +
 
 +
So the name of our binary <code>.ipl</code> would be as below,
 +
 
 +
test_stream0.ipl
 +
test_stream1.ipl
 +
test_stream2.ipl
 
  ...
 
  ...
  end
+
  etc
 +
 
 +
Then we'll need to import them in any of the [[IMG_archive|IMG Archives]].
 +
 
 +
For a detailed tutorial see [https://gtaforums.com/topic/911878-sacreating-custom-binary-ipl/ here].
 +
 
 +
== Format ==
 +
 
 +
The following table contains all known sections in the item placement. The supported games column lists games that support the sections but it doesn't necessarily mean they're functional in the games.
 +
 
 +
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
 +
!style="width: 7em;"|Section
 +
!style="width: 8em;"|Supported games
 +
!Description
 +
|-
 +
|<code>[[INST|inst]]</code>||{{Icon|t}} {{Icon|4}}||Places objects defined in <code>[[OBJS|objs]]</code>, <code>[[TOBJ|tobj]]</code>, <code>[[ANIM|anim]]</code>, or <code>[[TANM|tanm]]</code> into the world.
 +
|-
 +
|<code>[[ZONE|zone]]</code>||{{Icon|t}} {{Icon|4}}||Creates map, navigation, and info zones.
 +
|-
 +
|<code>[[CULL|cull]]</code>||{{Icon|t}} {{Icon|4}}||Creates zones with special attributes.
 +
|-
 +
|<code>[[PICK|pick]]</code>||{{Icon|3|16||GTA III (not functional)}} {{Icon|VC|16||Vice City (not functional)}} {{Icon|SA}} {{Icon|4|16||GTA IV (not functional)}}||Creates pickups. This section is only functional in San Andreas.
 +
|-
 +
|<code>[[PATH|path]]</code>||{{Icon|VC}}||Creates waypoints for random ''NPC'' spawns.<br>Note: this section is also present in ''San Andreas'' and ''GTA IV''. It is used as a base for ''Rockstar's'' paths compiler, but gets ignored by the games. For more information see: [[Paths]].
 +
|-
 +
|<code>[[OCCL|occl]]</code>||{{Icon|VC}} {{Icon|SA}} {{Icon|4}}||Creates occlusion zones.
 +
|-
 +
|<code>[[MULT|mult]]</code>||{{Icon|SA|16||San Andreas (not functional)}} {{Icon|4|16||GTA IV (not functional)}}||This section is not functional.
 +
|-
 +
|<code>[[GRGE|grge]]</code>||{{Icon|SA}} {{Icon|4}}||Creates garages.
 +
|-
 +
|<code>[[ENEX|enex]]</code>||{{Icon|SA}} {{Icon|4}}||Creates entry-exit markers.
 +
|-
 +
|<code>[[CARS (IPL Section)|cars]]</code>||{{Icon|SA}} {{Icon|4}}||Creates car generators (parked cars).
 +
|-
 +
|<code>[[JUMP|jump]]</code>||{{Icon|SA}} {{Icon|4|16||GTA IV (not functional)}}||Creates stunt jumps. This section is not functional in GTA IV.
 +
|-
 +
|<code>[[TCYC|tcyc]]</code>||{{Icon|SA}} {{Icon|4}}||Creates time cycles modifiers.
 +
|-
 +
|<code>[[AUZO|auzo]]</code>||{{Icon|SA}} {{Icon|4|16||GTA IV (not functional)}}||Creates [[Stream|audio]] zones. This section is not functional in GTA IV.
 +
|-
 +
|<code>[[MZON|mzon]]</code>||{{Icon|4}}||&ndash;
 +
|-
 +
|<code>[[VNOD|vnod]]</code>||{{Icon|4}}||Extended format of <code>path</code> &ndash; apparently only used for [[Multiplayer#GTA_4|multiplayer]] mode.
 +
|-
 +
|<code>[[LINK|link]]</code>||{{Icon|4}}||&ndash;
 +
|-
 +
|<code>[[BLOK|blok]]</code>||{{Icon|4|16||GTA IV (not functional)}}||This section is not functional. Appears to be used to allocate responsibilities during the development stage of ''GTA IV'', but also could be used to place [[Ped_Event|decision makers]].
 +
|-
 +
|<code>[[MLO+|mlo+]]</code>||{{Icon|4}}||<code>mlo</code> placement &ndash; Used to place offsets for ''GTA IV's'' [[interior]]s. The ''interiors'' themselves get placed inside the [[IDE]] file section <code>[[MLO|mlo]]</code>.
 +
|-
 +
|<code>[[2DFX (IPL Section)|2dfx]]</code>||{{Icon|4}}||Used to make many game effects, for example - Particle.
 +
|-
 +
|<code>[[LODM|lodm]]</code>||{{Icon|4}}||&ndash;
 +
|-
 +
|<code>[[SLOW|slow]]</code>||{{Icon|4}}||Unknown for what it is responsible, used very rare and only in two extended .WPL. Section contains a box.
 +
<!--|[[RTFX|rtfx]]||{{Icon|4}}||&ndash;-->
 +
|}
 +
 
  
===INST===
+
== Tools ==
Positions of static and dynamic ([[object.dat]]) map objects.
 
  
'''GTA3 format:'''
+
* [[KEd]] &ndash; By {{U|JernejL}}
id, name, x, y, z, sx, sy, sz, rx, ry, rz, rw
+
* [[MEd]] &ndash; By {{U|Tonywob}}
 +
* {{GTAF|315944|IPL Helper}} &ndash; By {{U|Xmen}}
 +
* [https://www.gtainside.com/en/sanandreas/tools/120305-binary-de-compiler/ Binary (De-)Compiler] &ndash; By {{U|ocram88}}
 +
* {{GTAF|429526|SA Binary IPL Exporter for 3DS Max}} &ndash; by {{U|Gforce}}
 +
* [https://gtaforums.com/topic/857375-fastman92-processor/ fastman92processor] &ndash; By {{U|fastman92}}
  
'''GTAVC format:'''
+
== See also ==
id, name, int, x, y, z, sx, sy, sz, rx, ry, rz, rw
 
  
'''GTASA format:'''
+
* [[Item definition]]
id, name, int, x, y, z, rx, ry, rz, rw lod
+
* [[WPL]] &ndash; Major ''GTA IV'' item placement file.
  
;ID: Unique object identifier. Must match in IDE file identifier.  (integer)
+
== External links ==
;Name: Usually same as the .dff model file, without extension (string)
 
;int: Interior number.  Zero for outside. (integer)
 
;x, y, z: Item placement coordinates. (floating point numbers)
 
;sx, sy, sz: Item scale, scales visible model only, doesn't scale the collision model. (floating point numbers)
 
;rx, ry, rz, rw: Item rotations.  Defined as quarternion, quite sophisticated math is needed to translate it to euler angles. A map editing program should be used to edit these.
 
;lod: San Andreas only.  This the line number in the current IPL file for the LOD which belongs to this object.  The first item in IPL file is line number 0, second is number 1 and so on.  A value of -1 means no LOD is used. (integer)
 
  
===PATH===
+
* {{GTAF|118193|GTA3/VC Map File Documentation and Troubleshooting}} - Topic by {{U|Opius}} covering general features of IPL files in GTA3 and GTA VC.
'''Ped, Car and Boat Paths''', defines paths relative to the world centre. Only used in ''GTA-VC'', this format is much easier than in GTA3 where the paths were stored in IDE files, and GTA-SA paths which are stored in **nodes.dat inside gta3.img.  This is a quite complicated format and hardly usable without an editing program (such as [[Ked]]).
+
* {{GTAF|202532|GTA SA IPL Documentation}} - Topic by {{U|spaceeinstein}} covering details of the IPL format in GTA SA.
  
==External Links==
+
{{N|IV|VCS|LCS|SA|VC|III}}
* [http://www.gtaforums.com/index.php?showtopic=202532 GTASA IPL Documentation] - GTA Forums topic covering details of the IPL format in GTASA.
 
* [http://www.gtaforums.com/index.php?showtopic=188549&view=findpost&p=3177288 Explanation of GTASA LOD System] - GTA Forums message by Steve-M, explaining the LOD system for IPL files in GTASA.
 
  
{{file-stub}}
+
[[Category:Map Formats]]
[[Category:Map Formats]][[Category:GTA 3]][[Category:GTA VC]][[Category:GTA SA]]
 

Latest revision as of 23:12, 12 January 2021

Item Placement
IPL Sections:
2DFX AUZO BLOK CARS CULL ENEX GRGE
INST JUMP LINK LODM MLO+ MULT OCCL
PATH PICK RTFX SLOW TCYC VNOD ZONE

Item placement files, usually identified by the file extension .ipl, are a part of the map system and used to create and place (for example) different objects, zones of special behavior or paths in the world. All games support standard item placement files which are mostly stored in plain text format that can be opened and edited using any text-editing program (like Notepad), but there are tools to simplify editing of the newly introduced Binary Ipl in San Andreas. Most of the placement information in GTA IV is stored inside of binary files (see WPL).

Text Format

The structure and format of the plain text item placement files are similar to that of the item definition files. The game searches for these files in gta.dat.They allow comments by the character #.Lines starting with this character simply get ignored by the game & empty lines are also allowed. Since these files contain different types of data a keyword is required for the game to recognize each set of data.

 <keyword>
 *lines*
 end

More information about these keywords can be found below in the Fomats section.

See also: Item Definition § Overview


Binary Format

San Andreas introduced a simple binary format of item placement files. They are stored as "streaming files" inside the archive files. Editing them requires an special editor (see below). The format is pretty simple and their possibilities are not completely used by Rockstar. By default they do only support inst and cars sections. It is unconfirmed if other sections also can be used or if they are just stubs which are not implemented. Anyway, their binary format is completely unknown.

This section is incomplete. You can help by fixing and expanding it.

Header

Each binary placement information file starts with a 4-Byte identifier followed by a header containing information about the content of the files.

4b  - CHAR[4]   - Always "bnry"
4b  - INT32     - Number of item instances
4b  - INT32     - Number of unknown 1 (CULL ?)
4b  - INT32     - Number of unknown 2 (GRGE ?)
4b  - INT32     - Number of unknown 3 (ENEX ?)
4b  - INT32     - Number of parked cars
4b  - INT32     - Number of unknown 4 (PICK ?)
4b  - INT32     - Offset of item instances (0x4C by default)
4b  - INT32     - Size of item instances (unused - always 0)
4b  - INT32     - Offset of unknown 1
4b  - INT32     - Size of unknown 1 (unused - always 0)
4b  - INT32     - Offset of unknown 2
4b  - INT32     - Size of unknown 2 (unused - always 0)
4b  - INT32     - Offset of unknown 3
4b  - INT32     - Size of unknown 3 (unused - always 0)
4b  - INT32     - Offset of parked cars
4b  - INT32     - Size of parked cars (unused - always 0)
4b  - INT32     - Offset of unknown 4
4b  - INT32     - Size of unknown 4 (unused - always 0)

The header is followed by the arrays of the entries.INST arrays have a size of 40 bytes per structure, and cars have 48 bytes.

INST

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  - INT32    - Object ID (as an index to the IDE)
4b  - INT32    - Interior
4b  - INT32    - LOD index

CARS

CARS is one of the known sections which can be used in binary format inside streaming files. It's format is similar to the plain text format:

4b  - FLOAT    - Position X
4b  - FLOAT    - Position Y
4b  - FLOAT    - Position Z
4b  - FLOAT    - Angle (Around Z-Axis)
4b  - INT32    - Object ID (an index to an vehicle definition)
4b  - INT32    - Primary color
4b  - INT32    - Secondary color
4b  - INT32    - Force spawn (Windows BOOL - see WinDef.h)
4b  - INT32    - Alarm probability
4b  - INT32    - Locked probability
4b  - INT32    - Unknown1 (Could be tertiary color)
4b  - INT32    - Unknown2 (Could be quarterdeck color)

Load a custom file

A basic comparison between a normal .ipl and a binary .ipl.

Normal:

15072, PLS_carpark, 0, 2579.8796445, 645.50208432, 9.93, 0, 0, 0, 1, -1

Binary:

15072, dummy, 0, 2579.8796445, 645.50208432, 9.93, 0, 0, 0, 1, -1

The object name is basically ignored in .ipl

Now for converting a text .ipl to binary .ipl and vice-versa,we can use fastman92-processor.Its a pretty simple program we can get most of the work done by editing the fastman92_processor.bat(Or can use Binary (De-)Compiler).

After converting to binary form we have to create a normal .ipl file and index it in Gta.dat.Lets suppose the name of our .ipl is

test.ipl

So the name of our binary .ipl would be as below,

test_stream0.ipl 
test_stream1.ipl 
test_stream2.ipl 
...
etc

Then we'll need to import them in any of the IMG Archives.

For a detailed tutorial see here.

Format

The following table contains all known sections in the item placement. The supported games column lists games that support the sections but it doesn't necessarily mean they're functional in the games.

Section Supported games Description
inst GTA III Vice City San Andreas GTA IV Places objects defined in objs, tobj, anim, or tanm into the world.
zone GTA III Vice City San Andreas GTA IV Creates map, navigation, and info zones.
cull GTA III Vice City San Andreas GTA IV Creates zones with special attributes.
pick GTA III (not functional) Vice City (not functional) San Andreas GTA IV (not functional) Creates pickups. This section is only functional in San Andreas.
path Vice City Creates waypoints for random NPC spawns.
Note: this section is also present in San Andreas and GTA IV. It is used as a base for Rockstar's paths compiler, but gets ignored by the games. For more information see: Paths.
occl Vice City San Andreas GTA IV Creates occlusion zones.
mult San Andreas (not functional) GTA IV (not functional) This section is not functional.
grge San Andreas GTA IV Creates garages.
enex San Andreas GTA IV Creates entry-exit markers.
cars San Andreas GTA IV Creates car generators (parked cars).
jump San Andreas GTA IV (not functional) Creates stunt jumps. This section is not functional in GTA IV.
tcyc San Andreas GTA IV Creates time cycles modifiers.
auzo San Andreas GTA IV (not functional) Creates audio zones. This section is not functional in GTA IV.
mzon GTA IV
vnod GTA IV Extended format of path – apparently only used for multiplayer mode.
link GTA IV
blok GTA IV (not functional) This section is not functional. Appears to be used to allocate responsibilities during the development stage of GTA IV, but also could be used to place decision makers.
mlo+ GTA IV mlo placement – Used to place offsets for GTA IV's interiors. The interiors themselves get placed inside the IDE file section mlo.
2dfx GTA IV Used to make many game effects, for example - Particle.
lodm GTA IV
slow GTA IV Unknown for what it is responsible, used very rare and only in two extended .WPL. Section contains a box.


Tools

See also

External links