Difference between revisions of "Item Definition"

From GTAMods Wiki
Jump to navigation Jump to search
(2DFX: everything known is complete)
m
 
(60 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{Cleanup-rewrite}}
+
{{IdeSection
{{IdeSection}}
+
| noheader = 1
'''Item definition''' files, known by the extension '''.ide''', are usually used to assign a model and texture file to a unique object ID, along with many parameters depending on the section. These files are in human readable text format, and allow the # character to comment lines out. IDE files can easily be opened and edited using any text-editing program like [[Wikipedia:Notepad|Notepad]].
+
}}
 +
'''Item definition''' files, usually identified by the file extension <code>.ide</code>, are used to declare many different aspects for the map system or to specify special behaviour rules for one of the aspects.
  
==Structure==
+
== Format ==
The .ide 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.
+
The files are plain text, so they can be opened with text editors such as Notepad. They resemble [[wikipedia:Comma-separated_values|CSV files]], but with some extra features.
  
Example:
+
=== Comments ===
objs
+
Comments are prefixed with the <code>#</code> symbol. Anything after that symbol is ignored, which means that comments can appear on their own lines as well as at the end of other lines:
...
+
<syntaxhighlight lang="perl">
end
+
# This comment has its own line.
 +
data1, 183, 2.2 # This comment is at the end of a line.
 +
</syntaxhighlight>
  
===[[OBJS]]===
+
=== Sections ===
Used to define standard static map objects.
+
Files are separated into sections with <code>section...end</code> directives:
  
''GTA III, VC and SA format''
+
<syntaxhighlight lang="tcl">
ID, ModelName, TextureName, ObjectCount, DrawDist, [DrawDist2, ...], Flags
+
section_name
 +
# ...
 +
end
 +
</syntaxhighlight>
  
{|{{Prettytable}} width="100%" class="collapsible collapsed"
+
Sections are global – multiple files can contribute to them
!width="250px"|Identifier
+
 
!Description
+
=== Data ===
|-
+
Data values can be comma- or space-delimited: commas are replaced with spaces when the game reads a line from the file.
|<center>ID</center>||unique object ID (integer)
+
 
|-
+
<syntaxhighlight lang="perl">
|<center>ModelName</center>||name of the .dff [[model file]], without extension (string)
+
# Both are valid:
|-
+
123, mystring, 22.4
|<center>TextureName</center>||name of the .txd [[texture dictionary]], without extension (string)
+
123 mystring 22.4
|-
+
</syntaxhighlight>
|<center>ObjectCount</center>||amount of sub objects, e.g. damaged parts, usually 1 (integer) - '''''optional for SA, default 1'''''
 
|-
 
|<center>DrawDist</center>||[[draw distance]] in [[unit]]s, one for each sub object (float)
 
|-
 
|<center>Flags</center>||[[OBJS#Object Flags|object flags]], defining special behavior, default 0 (integer)
 
|}
 
  
''GTA IV format''
+
Additionally, because the game uses [https://en.cppreference.com/w/cpp/io/c/fscanf#Parameters|<code>sscanf()</code>] to parse these files, any number of spaces is read whenever a single space is encountered in the format string in the game code. As such, values can be aligned into columns:
  
ModelName, TextureName, DrawDistance, Flag1, Flag2, (Bounds min)X,Y,Z, (Bounds max)X,Y,Z, (Bounds Sphere)X, Y, Z, Radius, WDD
+
<syntaxhighlight lang="perl">
 +
# Identifier    Some value    Another value
 +
  1              a_value        12345
 +
  2              another        67890
 +
</syntaxhighlight>
  
Note that GTA IV does not use any unique object ID numbers
+
Rockstar developers used this alignment ability a lot.
  
{|{{Prettytable}} width="100%" class="collapsible collapsed"
+
=== Rules and details ===
!width="250px"|Identifier
+
* The game only reads 256 characters per line. Anything longer will be truncated.
!Description
+
* Section identifiers and the <code>end</code> string are case-sensitive.
|-
+
* The files are ASCII-encoded. The game does not expect non-ASCII characters to appear, so they will likely cause issues.
|<center>ModelName</center>||name of the .wdr [[model file]], without extension (string)
+
* Decimal places in floating-point values must use <code>.</code> as the decimal point character. <code>,</code> would be replaced with a space when read.
|-
+
* Any ASCII [[wikipedia:Control_character|control characters]] – anything less than the space character, <syntaxhighlight lang="c" inline>0x20</syntaxhighlight> – is replaced with a space when the game reads the character. The same is done for commas.
|<center>TextureName</center>||name of the .wtd [[texture dictionary]], without extension (string)
+
* After reading a line, the game re-reads it to find the first character that is not a space or control character. The final line string starts from this character. This is equivalent to trimming the start of the string.
|-
+
* In 3D era games, the section identifiers are always 4 characters long. GTA IV largely adheres to this convention, but not always.
|<center>DrawDistance</center>||[[draw distance]] in [[unit]]s, one for each sub object (float)
 
|-
 
|<center>Flag1</center>||object flag, defining special behavior
 
|-
 
|<center>Flag2</center>||object flag, defining special behavior, default 0 (integer)
 
|-
 
|<center>Bounds Min</center>||Lower Left vertex local position of a model bounding box
 
|-
 
|<center>Bounds Max</center>||Upper Right vertex local position of a model bounding box
 
|-
 
|<center>Radius</center>||Radius dimensions of the bounding Sphere
 
|-
 
|<center>WDD</center>||the model dictionary file that contains the LOD model for the defined Modelname
 
|}
 
  
===[[TOBJ]]===
+
== Sections ==
Used to define timed map objects. All but the last two columns are the same as the OBJS section.
 
  
''GTA III, VC and SA format:''
+
The following table contains all known sections in the item definition. The supported games column lists games that support the sections but it doesn't necessarily means they're functional in the games.
ID, ModelName, TextureName, ObjectCount, DrawDist, [DrawDist2, ...], Flags, TimeOn, TimeOff
 
  
{|{{Prettytable}} width="100%" class="collapsible collapsed"
+
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
!width="250px"|Identifier
+
!style="width: 7em;"|Section
 +
!style="width: 8em;"|Supported games
 
!Description
 
!Description
 
|-
 
|-
|<center>ID</center>||unique object ID (integer)
+
|<code>[[OBJS|objs]]</code>||{{Icon|t}} {{Icon|4}}||Defines simple objects. They can be placed into the world through the <code>[[INST|inst]]</code> section of the [[IPL|item placement files]].
 +
|-
 +
|<code>[[TOBJ|tobj]]</code>||{{Icon|t}} {{Icon|4}}||Defines time objects. The section functions similarly to <code>objs</code> but has two additional parameters defining the in-game time range the object can get rendered. These objects can be placed into the world through the <code>inst</code> section of the item placement files.
 
|-
 
|-
|<center>ModelName</center>||name of the .dff [[model file]], without extension (string)
+
|<code>[[HIER|hier]]</code>||{{Icon|t}} {{Icon|4}}||Defines clump objects for use in cutscenes.
 
|-
 
|-
|<center>TextureName</center>||name of the .txd [[texture dictionary]], without extension (string)
+
|<code>[[CARS (IDE Section)|cars]]</code>||{{Icon|t}} {{Icon|4}}||Defines vehicle objects.
 
|-
 
|-
|<center>ObjectCount</center>||amount of sub objects, e.g. damaged parts, usually 1 (integer) - '''''optional for SA, default 1'''''
+
|<code>[[PEDS|peds]]</code>||{{Icon|t}} {{Icon|4}}||Defines pedestrian objects (random [[wikipedia:Non-player character|NPC's]]).
 
|-
 
|-
|<center>DrawDist</center>||[[draw distance]] in [[unit]]s, one for each sub object (float)
+
|<code>[[PATH (IDE Section)|path]]</code>||{{Icon|3}} {{Icon|VC|16||Vice City (unstable)}} {{Icon|SA}}||Adds path nodes to defined objects. This section is unstable in Vice City.
 
|-
 
|-
|<center>Flags</center>||object flags, defining special behavior, default 0 (integer)
+
|<code>[[2DFX|2dfx]]</code>||{{Icon|t}} {{Icon|4}}||Adds particle effects and simple ped behaviors to defined objects.
 
|-
 
|-
|<center>TimeOn</center>||activation time in game hours (integer)
+
|<code>[[WEAP|weap]]</code>||{{Icon|VC}} {{Icon|SA}} {{Icon|4}}||Defines weapon objects.
 
|-
 
|-
|<center>TimeOff</center>||deactivation time in game hours (integer)
+
|<code>[[ANIM|anim]]</code>||{{Icon|SA}} {{Icon|4}}||Defines animated objects. The section functions similarly to <code>objs</code> but has one additional parameter indicating an [[IFP]] or [[WAD]] animation file to assign an animation to the object. These objects can be placed into the world through the <code>inst</code> section of the item placement files.
|}
 
 
 
''GTA IV format''
 
 
 
ModelName, TextureName, DrawDist, Flag1, Flag2, (Bounds min)X,Y,Z, (Bounds max)X,Y,Z, (Bounds Sphere)X,Y,Z, Radius, WDD, NightFlag
 
 
 
Note that GTA IV does not use any unique object ID numbers.
 
 
 
{|{{Prettytable}} width="100%" class="collapsible collapsed"
 
!width="250px"|Identifier
 
!Description
 
 
|-
 
|-
|<center>ModelName</center>||name of the .wdr [[model file]], without extension (string)
+
|<code>[[TXDP|txdp]]</code>||{{Icon|SA}} {{Icon|4}}||Used to virtually extend [[TXD|texture dictionaries]].
 
|-
 
|-
|<center>TextureName</center>||name of the .wtd [[texture dictionary]], without extension (string)
+
|<code>[[TANM|tanm]]</code>||{{Icon|4}}||Used to combine <code>tobj</code> and <code>anim</code> sections.<br>Those objects get placed inside the <code>inst</code> section of the ''WPL''.
 
|-
 
|-
|<center>DrawDistance</center>||[[draw distance]] in [[unit]]s, one for each sub object (float)
+
|<code>[[TREE|tree]]</code>||{{Icon|4|16||GTA IV (not functional)}}||This section is not functional.
 
|-
 
|-
|<center>Flag1</center>||object flag, defining special behavior
+
|<code>[[VNOD|vnod]]</code>||{{Icon|4}}||&ndash;
 
|-
 
|-
|<center>Flag2</center>||object flag, defining special behavior, default 0 (integer)
+
|<code>[[LINK|link]]</code>||{{Icon|4}}||&ndash;
 
|-
 
|-
|<center>Bounds Min</center>||Lower Left vertex local position of a model bounding box
+
|<code>[[MLO|mlo]]</code>||{{Icon|4}}||Used to create [[interior]]s. This section does also contain information about portals (previous <code>[[ENEX|enex]]</code> connections) and dimensions of the interior which influences certain aspects, like the weather, for example. All objects are placed relative to an offset placed using <code>[[MLO+|mlo+]]</code> inside the [[IPL]] or [[WPL]] file.
 
|-
 
|-
|<center>Bounds Max</center>||Upper Right vertex local position of a model bounding box
+
|<code>[[AMAT|amat]]</code>||{{Icon|4}}||This is Audio Materials. Possible Used to make a sound effect at the model. Usually used for dynamic objects.
 
|-
 
|-
|<center>Radius</center>||Radius dimensions of the bounding Sphere
+
|<code>[[LODM|lodm]]</code>||{{Icon|4|16||GTA IV (not functional)}}||This section is not functional.
 
|-
 
|-
|<center>WDD</center>||the model dictionary file that contains the LOD model for the defined Modelname
+
|<code>[[AGRPS|agrps]]</code>||{{Icon|4}}||&ndash;
 
|-
 
|-
|<center>NightFlag</center>||assumed to be hardcoded time flags
+
|<code>[[HAND|hand]]</code>||VC Xbox/Mobile||&ndash;
 
|}
 
|}
  
===ANIM===
+
== IDE Flags ==
'''Animated Map Objects''', used to define objects whose sub objects are animated. Note: There must be animation frames for each sub object, also the collision model remains static - no solid animations.
 
 
 
''GTA SA only:''
 
ID, ModelName, TextureName, AnimName, DrawDist, Flags
 
;ID, ModelName, TextureName, DrawDist, Flags: same as for the OBJS section
 
;AnimName: name of the [[IFP|animation archive]], without extension (string)
 
 
 
''GTA IV format''
 
 
 
ModelName, TextureName, Wad, DrawDist, Flag1, Flag2, (Bounds min)X,Y,Z, (Bounds max)X,Y,Z, (Bounds Sphere)X,Y,Z, Radius, WDD
 
 
 
;ModelName, TextureName, DrawDistance, Flags, Bounds min, Bounds max, Bounds Sphere X,Y,Z, Radius, WDD: same as for the OBJS section
 
 
 
;Wad: name of the (.wad) animation archive, without extension (string)
 
 
 
===[[PEDS]]===
 
Used to define characters and pedestrians
 
  
''GTA III format:''
+
Flags are used in order to specify the behaviour of objects. They are interpreted as signed 32-bit integer values where each bit describes a [[wikipedia:Boolean_algebra_(logic)|boolean]] value of a different aspect.
ID, ModelName, TxdName, Threat, Behavior, AnimationType, VehClass
 
  
{|{{Prettytable}} width="100%" class="collapsible collapsed"
+
=== {{Icon|3}} GTA III ===
!width="250px"|Identifier
+
{| class="wikitable"
!Description
+
! Bits !! Dec !! Hex !! Name !! Description !! Examples
|-
 
|<center>ID</center>||Unique model ID
 
|-
 
|<center>ModelName</center>||Name of the .dff [[model file]], without extension
 
|-
 
|<center>TxdName</center>||Name of the .txd [[texture dictionary]], without extension
 
|-
 
|<center>Threat</center>||The threat of the ped as defined in the ped.dat file
 
|-
 
|<center>Behavior</center>||The behavior of the ped as defined in the pedstats.dat file
 
|-
 
|<center>AnimationType</center>||The type of animation being used on the ped for movements
 
|-
 
|<center>VehClass</center>||The class of vehicle that the ped will drive<br>The value is in hex! It needs to be converted into decimal and back
 
|}
 
 
 
''Vice City format''
 
ID, ModelName, TxdName, Threat, Behavior, AnimationType, VehClass, StartAnimation?, Radio1, Radio2
 
 
 
{|{{Prettytable}} width="100%" class="collapsible collapsed"
 
!width="250px"|Identifier
 
!Description
 
|-
 
|<center>ID</center>||Unique model ID
 
 
|-
 
|-
|<center>ModelName</center>||Name of the .dff [[model file]], without extension
+
| 0 || 1 || 0x1 || - || Cull model if player doesn't look at it? Read, but ignored. || Fences
 
|-
 
|-
|<center>TxdName</center>||Name of the .txd [[texture dictionary]], without extension
+
| 1 || 2{{ref|1}} || 0x2 || DO_NOT_FADE || Do not fade the object when it is being loaded into or out of view. || Some lampposts
 
|-
 
|-
|<center>Threat</center>||The threat of the ped as defined in the ped.dat file
+
| 2 || 4{{ref|1}} || 0x4 || DRAW_LAST || Model is transparent. Render this object after all opaque objects, allowing transparencies of other objects to be visible through this object. || Trees
 
|-
 
|-
|<center>Behavior</center>||The behavior of the ped as defined in the pedstats.dat file
+
| 3 || 8 || 0x8 || ADDITIVE || Render with additive blending. Previous flag must be enabled too. ||
 
|-
 
|-
|<center>AnimationType</center>||The type of animation being used on the ped for movements
+
| 4 || 16{{ref|1}} || 0x10 || IS_SUBWAY || Model is a tunnel, i.e. set the object as invisible unless the player enters [[Cullzone.dat|cull zone flag 128]]. This flag works only with static models. || Tunnels, some dynamic objects
 
|-
 
|-
|<center>VehClass</center>||The class of vehicle that the ped will drive<br>The value is in hex! It needs to be converted into decimal and back
+
| 5 || 32 || 0x20 || IGNORE_LIGHTING || Don't use static lighting, we want dynamic if it's possible. || Some lampposts and trafficlights
 
|-
 
|-
|<center>Radio1, Radio2</center>||Ped's preferred radio station
+
| 6 || 64{{ref|1}} || 0x40 || NO_ZBUFFER_WRITE || Model is a shadow. Disable writing to z-buffer when rendering it, allowing transparencies of other objects, shadows, and lights to be visible through this object. Not implemented in the PS2 version. || Shadow
 
|}
 
|}
  
===WEAP===
+
=== {{Icon|VC}} GTA Vice City ===
''GTA III and VC format:''
 
ID, ModelName, TextureName, Animation, ?, DrawDistance, ?
 
;Animation: From ped.ifp, animation used to wield and shoot the weapon
 
 
 
===[[CARS (IDE Section)|CARS]]===
 
Used to define vehicles
 
 
 
''GTA III formats''
 
 
 
''Car''
 
ID, ModelName, TxdName, Type, HandlingID, GameName, Class, Frequency, Level, Comprules, WheelID, WheelScale
 
 
 
''Boat and Train''
 
ID, ModelName, TxdName, Type, HandlingID, GameName, Class, Frequency, Level, Comprules
 
  
''Plane''
+
{| class="wikitable"
ID, ModelName, TxdName, Type, HandlingID, GameName, Class, Frequency, Level, Comprules, LODModel
+
! Bits !! Dec !! Hex !! Name !! Description !! Examples
 
 
{|{{Prettytable}} width="100%" class="collapsible collapsed"
 
!width="250px"|Identifier
 
!Description
 
|-
 
|<center>ID</center>||Unique model ID
 
 
|-
 
|-
|<center>ModelName</center>||Name of the .dff [[model file]], without extension
+
| 0 || 1 || 0x1 || IS_ROAD || Identifies objects to draw "wet reflections" on them. || Roads
 
|-
 
|-
|<center>TxdName</center>||Name of the .txd [[texture dictionary]], without extension
+
| 1 || 2 || 0x2 || DO_NOT_FADE || Do not fade the object when it is being loaded into or out of view. || Some night objects, North Point Mall
 
|-
 
|-
|<center>Type</center>||Type of vehicle, which includes ''car'', ''boat'', ''train'', and ''plane''<br>This data is related to hardcoded functions and must not be changed or else it might crash the game
+
| 2 || 4 || 0x4 || DRAW_LAST || Model is transparent. Render this object after all opaque objects, allowing transparencies of other objects to be visible through this object. || Fences, trees
 
|-
 
|-
|<center>HandlingID</center>||Name corresponding to its handling data in the [[handling.cfg]] file
+
| 3 || 8 || 0x8 || ADDITIVE || Render with additive blending. Previous flag will be enabled automatically. || Night windows
 
|-
 
|-
|<center>GameName</center>||Name corresponding to its [[GXT]] entry, case sensitive and must be seven characters or less!<br>Invalid name will show up as ''NAME missing''
+
| 4 || 16 || 0x10 || - || Read, but not used. || _dy, _dt objects
 
|-
 
|-
|<center>Class</center>||Class of the vehicle
+
| 5 || 32 || 0x20 || IGNORE_LIGHTING || Don't use static lighting, we want dynamic if it's possible. || Interior objects
 
|-
 
|-
|<center>Frequency</center>||Frequency of the vehicle spawning randomly on the streets
+
| 6 || 64 || 0x40 || NO_ZBUFFER_WRITE || Model is a shadow. Disable writing to z-buffer when rendering it, allowing transparencies of other objects, shadows, and lights to be visible through this object. || Tree shadows
 
|-
 
|-
|<center>Level</center>||unknown
+
| 7 || 128 || 0x80 || DONT_RECEIVE_SHADOWS || Do not draw dynamic shadows on this object. || Small objects, pickups, lamps, trees
 
|-
 
|-
|<center>Comprules</center>||unknown
+
| 8 || 256 || 0x100 || IGNORE_DRAW_DISTANCE || Ignore draw distance for this object (sets its "level" (island id) to 0). || LOD models, North Bridge
 
|-
 
|-
|<center>WheelID</center>||ID number of wheel model<br>Only available for type ''car'', has no effect if used on type ''boat''
+
| 9 || 512 || 0x200 || IS_GLASS_TYPE_1 || Breakable glass type 1: glass object changes its textures when breaking. || Small windows
 
|-
 
|-
|<center>WheelScale</center>||Scale of wheel and [[Collision File|collision]] models, 1.0 for original size of wheel and collision models<br>Only available for type ''car'', has no effect if used on type ''boat''
+
| 10 || 1024 || 0x400 || IS_GLASS_TYPE_2 || Breakable glass type 2: glass object doesn't change its textures when breaking. || Large windows
|-
 
|<center>LODModel</center>||ID number of LOD model, can be any valid vehicle model<br>Only available for type ''plane''
 
 
|}
 
|}
  
''Vice City formats''
+
==== Reference table ====
 
 
''Car''
 
ID, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Level, Comprules, WheelID, WheelScale
 
 
 
''Bike''
 
ID, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Level, Comprules, Unknown, WheelScale
 
 
 
''Boat and Heli''
 
ID, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Level, Comprules
 
 
 
''Plane''
 
ID, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Level, Comprules, LODModel
 
  
{|{{Prettytable}} width="100%" class="collapsible collapsed"
+
{| class="wikitable"
!width="250px"|Identifier
+
! Bits !! Dec !! Hex !! Name !! Model info flag !! Ref address !! Ref description
!Description
 
|-
 
|<center>ID</center>||Unique model ID
 
|-
 
|<center>ModelName</center>||Name of the .dff [[model file]], without extension
 
|-
 
|<center>TxdName</center>||Name of the .txd [[texture dictionary]], without extension
 
 
|-
 
|-
|<center>Type</center>||Type of vehicle, which includes ''car'', ''bike'', ''boat'', ''plane'', and ''heli''; flyable helicopters are type ''car''
+
| 0 || 1 || 0x1 || IS_ROAD || 0x04 || 0x4CA1D7 || <font face="Consolas"><b>CRenderer::RenderRoads()</b></font>
 +
<source lang="cpp">if (CModelInfo::GetModelInfo(entity->m_nModelIndex)->m_nFlags & IS_ROAD)
 +
    entity->Render();</source>
 
|-
 
|-
|<center>HandlingID</center>||Name corresponding to its handling data in the [[handling.cfg]] file.
+
| 1 || 2 || 0x2 || DO_NOT_FADE || 0x20 || 0x4C7E03 || <font face="Consolas"><b>CRenderer::ShouldModelBeStreamed(CEntity *,CVector const&)</b></font>
 +
<source lang="cpp">if (model->m_nFlags & DO_NOT_FADE) {
 +
    if (distance >= model->GetLargestLodDistance() + 30.0f)
 +
        return true;
 +
}
 +
else if ( distance >= model->GetLargestLodDistance() + 50.0f)
 +
    return true;</source>
 
|-
 
|-
|<center>GameName</center>||Name corresponding to its [[GXT]] entry, case sensitive and must be seven characters or less!<br>Invalid name will not show up in the game
+
| 2 || 4 || 0x4 || DRAW_LAST || 0x40 || 0x56F4F3 || <font face="Consolas"><b>CSimpleModelInfo::SetupBigBuilding(int,int)</b></font>
 +
<source lang="cpp">if (model->m_nFlags & DRAW_LAST) {
 +
    model->m_nFlags &= ~DRAW_LAST;
 +
    dbgprint("%s was draw last\n", model->m_szName);
 +
}</source>
 
|-
 
|-
|<center>Anims</center>||Appropriate animation file mainly used on bikes
+
| 3 || 8 || 0x8 || ADDITIVE || 0x80 || 0x582590 || <font face="Consolas"><b>CVisibilityPlugins::RenderFadingAtomic(RpAtomic *,float)</b></font>
 +
<source lang="cpp">if (model->m_nFlags & ADDITIVE)
 +
    RwRenderStateSet(rwRENDERSTATEDESTBLEND, rwBLENDONE);</source>
 
|-
 
|-
|<center>Class</center>||Class of the vehicle
+
| 4 || 16 || 0x10 || -  || 0x100 || - || -
 
|-
 
|-
|<center>Frequency</center>||Frequency of the vehicle spawning randomly on the streets
+
| 5 || 32 || 0x20 || IGNORE_LIGHTING || 0x200 || 0x56F7C4 || <font face="Consolas"><b>CSimpleModelInfo::SetAtomic(int,RpAtomic *)</b></font>
 +
<source lang="cpp">if (model->m_nFlags & IGNORE_LIGHTING)
 +
    atomic->geometry->flags &= ~rpGEOMETRYLIGHT;</source>
 
|-
 
|-
|<center>Level</center>||unknown
+
| 6 || 64 || 0x40 || NO_ZBUFFER_WRITE || 0x400 || 0x581390 || <font face="Consolas"><b>CVisibilityPlugins::RenderFadingEntities(CLinkList<CVisibilityPlugins::AlphaObjectInfo> &)</b></font>
 +
<source lang="cpp">if (model->m_nType == MODEL_INFO_SIMPLE && model->m_nFlags & NO_ZBUFFER_WRITE)
 +
    RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, FALSE);</source>
 
|-
 
|-
|<center>Comprules</center>||unknown
+
| 7 || 128 || 0x80 || DONT_RECEIVE_SHADOWS || 0x800 || 0x48AF21 || <font face="Consolas"><b>CFileLoader::LoadObjectInstance(char const*)</b></font>
 +
<source lang="cpp">if (model->m_nFlags & DONT_RECEIVE_SHADOWS)
 +
    entity->m_nFlags.bDontCastShadowsOn = true;</source>
 
|-
 
|-
|<center>WheelID</center>||ID number of wheel model<br>Only available for type ''car'', has no effect if used on type ''boat''
+
| 8 || 256 || 0x100 || IGNORE_DRAW_DISTANCE || 0x1000 || 0x487CDE || <font face="Consolas"><b>CEntity::SetupBigBuilding()</b></font>
 +
<source lang="cpp">if (model->m_afLodDistances[0] > 2500.0f || model->m_nFlags & IGNORE_DRAW_DISTANCE)
 +
    entity->m_nLevel = 0;</source>
 
|-
 
|-
|<center>WheelScale</center>||Scale of wheel and [[Collision File|collision]] models for type ''car'', scale of wheel collision model for type ''bike'', 1.0 for original size of wheel and collision models<br>Only available for types ''car'' and ''bike'', has no effect if used on type ''boat''
+
| 9 || 512 || 0x200 || IS_GLASS_TYPE_1 || 0x2000 || 0x488CCD || <font face="Consolas"><b>CEntity::PreRender()</b>, probably in-lined <b>CModelInfo::IsGlassModel(int)</b> @0x488CAA</font>
 +
<source lang="cpp">bool CModelInfo::IsGlassModel(int modelId) {
 +
    CBaseModelInfo *model = CModelInfo::GetModelInfo(modelId);
 +
    if (model->m_nType == MODEL_INFO_SIMPLE || model->m_nType == MODEL_INFO_TIME) {
 +
        CSimpleModelInfo *simpleModel = reinterpret_cast<CSimpleModelInfo *>(model);
 +
        return simpleModel->m_nFlags & IS_GLASS_TYPE_1 || simpleModel->m_nFlags & IS_GLASS_TYPE_2;
 +
    }
 +
    return false;
 +
}</source>
 
|-
 
|-
|<center>LODModel</center>||ID number of LOD model, can be any valid vehicle model<br>Only available for type ''plane''
+
| 10 || 1024 || 0x400 || IS_GLASS_TYPE_2 || 0x4000 || 0x488CE7 || <font face="Consolas"><b>CEntity::PreRender()</b></font>
 +
<source lang="cpp">if (CModelInfo::IsGlassModel(modelId)) {
 +
    if (!(CModelInfo::GetModelInfo(modelId)->m_nFlags & IS_GLASS_TYPE_2) ) {
 +
        CGlass::AskForObjectToBeRenderedInGlass(entity);
 +
        entity->m_nFlags.bIsVisible = false;
 +
    }
 +
}</source>
 
|}
 
|}
  
''SA Format comming soon''
+
=== {{Icon|SA}} GTA San Andreas ===
 
 
===HIER===
 
 
 
''SA Format only''
 
 
 
This is (e.g.) used in default.ide in the 'data\'-folder
 
Normal structure is like this:
 
 
 
  ID, model, texture, null, float (normally 2000.00)
 
 
 
The meaning of these lines isn't known yet, but it seems to be a kind of bodyparts for the player.
 
 
 
===TXDP===
 
;Texture Archive Parent
 
''SA and GTA 4 format''
 
TextureName, TextureParentName
 
Both parameters are names of texture archives (<code>.txd</code>). The second archive (the "parent") virtually extends the first one. Practically, the game looks up a texture in the primary archive, and if it's not there and a parent txd has been assigned, it checks for the texture in the parent archive. This way shared archives can be created, which contain often used textures, without the need to create duplicates or split up a model just for that purpose.
 
  
===[[2DFX]]===
+
{| class="wikitable"
Used to place lights, particles, and ped behaviors on objects
+
! Bits !! Dec !! Hex !! Name !! Description !! Examples
 
 
''GTA III and VC format''
 
 
 
''Type 0: Lights''
 
ID, X, Y, Z, R, G, B, unknown (0 or 200), 1, Corona, Shadow, Distance, Outer range, Size, Inner range, IDE flag, Wet, Flare, Dust
 
 
 
{|{{Prettytable}} width="100%" class="collapsible collapsed"
 
!width="250px"|Identifier
 
!Description
 
|-
 
|<center>ID</center>||associated to existing object ID defined in [[OBJS]] section
 
|-
 
|<center>X, Y, Z</center>||X, Y, and Z coordinates relative to the center of the object
 
 
|-
 
|-
|<center>R, G, B</center>||color of the light and everything associated it in RGB format
+
| 0 || 1 || 0x1 || IS_ROAD || This model is a road. || Roads
 
|-
 
|-
|<center>Corona</center>||corona associated to the light defined in <code>particle.txd</code>, usually "coronastar" for lighta
+
| 1 || 2 || 0x2 || - || Not read, but present in IDE files. ||
 
|-
 
|-
|<center>Shadow</center>||shadow associated to the light?, usually "shad_exp"
+
| 2 || 4 || 0x4 || DRAW_LAST || Model is transparent. Render this object after all opaque objects, allowing transparencies of other objects to be visible through this object. || Fences, trees
 
|-
 
|-
|<center>Distance</center>||view distance of the light, is limited by the draw distance of the host object
+
| 3 || 8 || 0x8 || ADDITIVE || Render with additive blending. Previous flag will be enabled automatically. || Night windows
 
|-
 
|-
|<center>Outer range</center>||the range the light can cast on objects, cars, and peds
+
| 4 || 16 || 0x10 || - || Not read, not present in IDE files. || -
 
|-
 
|-
|<center>Size</center>||the size of the corona, can be a float or integer, size 0 means no visible corona but effect of light still visible
+
| 5 || 32 || 0x20 ||  || Works only with animated objects ('anim' section in IDE). || Doors
 
|-
 
|-
|<center>Inner range</center>||the range the light can cast on the ground
+
| 6 || 64 || 0x40 || NO_ZBUFFER_WRITE || Disable writing to z-buffer when rendering this model, allowing transparencies of other objects, shadows, and lights to be visible through this object. || Shadows, lights
 
|-
 
|-
|<center>IDE flag</center>||IDE flag, only the time-dependent flags are useable
+
| 7 || 128 || 0x80 || DONT_RECEIVE_SHADOWS || Do not draw shadows on this object. || Small objects, pickups, lamps, trees
 
|-
 
|-
|<center>Flash</center>||sets the [[2DFX#Types of Flashes|type of flashing]]
+
| 8 || 256 || 0x100 || - || Not read, not present in IDE files. || -
 
|-
 
|-
|<center>Wet</center>||sets the particle to be "reflective" on wet grounds
+
| 9 || 512 || 0x200 || IS_GLASS_TYPE_1 || Breakable glass type 1 (additional parameters defined inside the object.dat file, otherwise there is no effect) || Small windows
 
|-
 
|-
|<center>Flare</center>||sets the particle to create a lens flare on the screen, similar to what the sun does<br>0 - no lens flare, 1 - lens flare effect
+
| 10 || 1024 || 0x400 || IS_GLASS_TYPE_2 || Breakable glass type 2: object first cracks on a strong collision, then it breaks (does also require object.dat registration). || Large windows
 
|-
 
|-
|<center>Dust</center>||sets the intensity of light reflecting off dust, values 4 to 7 have visible effects
+
| 11 || 2048 || 0x800 || IS_GARAGE_DOOR || Indicates an object as an garage door (for more information see GRGE – requires object.dat registration). || Garage doors
|}
 
 
 
''Type 1: Particle''
 
ID, X, Y, Z, R, G, B, unknown (63 or 200), 2, Particle, unk1, unk2, unk3, Size
 
 
 
{|{{Prettytable}} width="100%" class="collapsible collapsed"
 
!width="250px"|Identifier
 
!Description
 
 
|-
 
|-
|<center>ID</center>||associated to existing object ID defined in [[OBJS]] section
+
| 12 || 4096 || 0x1000 || IS_DAMAGABLE || Model with ok/dam states. || Vehicle upgrades, barriers
 
|-
 
|-
|<center>X, Y, Z</center>||X, Y, and Z coordinates relative to the center of the object
+
| 13 || 8192 || 0x2000 || IS_TREE || Trees and some plants. These objects move on wind. || Trees, some plants
 
|-
 
|-
|<center>R, G, B</center>||useless values
+
| 14 || 16384 || 0x4000 || IS_PALM || Palms. These objects move on wind. || Palms
 
|-
 
|-
|<center>Particle</center>||[[2DFX#Types of Particles|particle type]]
+
| 15 || 32768 || 0x8000 || DOES_NOT_COLLIDE_WITH_FLYER || Does not collide with flyer (plane or heli). || Trees, street lights, traffic lights, road signs, telegraph pole
 
|-
 
|-
|<center>Size</center>||the size of the particle
+
| 16 || 65536 || 0x10000 || - || Not read, but present in IDE files. || Explosive things
|}
 
 
 
''Type 3: Peds (Vice City only)''
 
ID, X, Y, Z, R, G, B, unknown (200), 3, Behavior, unk1, unk2, unk3, RotX, RotY, RotZ
 
 
 
{|{{Prettytable}} width="100%" class="collapsible collapsed"
 
!width="250px"|Identifier
 
!Description
 
 
|-
 
|-
|<center>ID</center>||associated to existing object ID defined in [[OBJS]] section
+
| 17 || 131072 || 0x20000 || - || Not read, but present in IDE files. || chopcop_ models
 
|-
 
|-
|<center>X, Y, Z</center>||X, Y, and Z coordinates relative to the center of the object
+
| 18 || 262144 || 0x40000 || - || Not read, but present in IDE files. || pleasure-DL.dff
 
|-
 
|-
|<center>R, G, B</center>||useless values
+
| 19 || 524288 || 0x80000 || - || Unused special object type. Read, but not present in IDE files. || -
 
|-
 
|-
|<center>Animation</center>||[[2DFX#Types of Behaviors|behavior type]]
+
| 20 || 1048576 || 0x100000 || IS_TAG || This model is a tag. Object will switch from mesh 2 to mesh 1 after getting sprayed by the player. || Tags
 
|-
 
|-
|<center>unk1, unk2, unk3</center>||unknown, useless values?
+
| 21 || 2097152 || 0x200000 || DISABLE_BACKFACE_CULLING || Disables backface culling – as an result the texture will be drawed on both sides of the model. || Roads, houses, trees, vehicle parts
 
|-
 
|-
|<center>RotX, RotY, RotZ</center>||rotation of ped when animation is playing
+
| 22 || 4194304 || 0x400000 || IS_BREAKABLE_STATUE || Object with this model can't be used as cover, i.e. peds won't try to cover behind this object. || Statue parts in atrium
 
|}
 
|}
  
''Type 4: Sun Reflections (Vice City only)''
+
=== {{Icon|4}} GTA IV ===
ID, X, Y, Z, R, G, B, unknown (120), 4
+
{{Incomplete}}
 
 
{|{{Prettytable}} width="100%" class="collapsible collapsed"
 
!width="250px"|Identifier
 
!Description
 
|-
 
|<center>ID</center>||associated to existing object ID defined in [[OBJS]] or [[TOBJ]] section
 
|-
 
|<center>X, Y, Z</center>||X, Y, and Z coordinates relative to the center of the object
 
|-
 
|<center>R, G, B</center>||useless values
 
|}
 
 
 
Please note that the 2dfx Section is moved to the DFF Files by using R*'s custom section IDs in SA!
 
 
 
Please also note that the 2dfx Lights Section is present within GTA-IV [[WDR]] map models
 
 
 
===PATH===
 
'''Ped and Car Paths''', defines paths relative to the objects. Only used in ''GTA III'', quite complicated format and hardly usable without a editing program (such as [[Ked]]).
 
 
 
===TREE===
 
''GTA4 only''
 
 
 
===TANM===
 
''GTA4 only''
 
  
===MLO===
+
== Difference between GTA III and GTA IV engines ==
''GTA4 only''
 
  
===AMAT===
+
[[GTA IV]] not only uses different formats to the previous games, it also does not use IDs to identify objects anymore. While [[GTA 3|GTA III]] era games use an ID as an index inside an array of definitions, GTA IV uses the hashes of the model name as a key inside a hash table. For more information about this see [[Map system]].
''GTA4 only''
 
  
Modelname, Flag1, Flag2
+
== Tools ==
  
==Procobj.ide==
+
* [[KEd]] &ndash; By {{U|JernejL}}
 +
* [[MEd]] &ndash; By {{U|Tonywob}}
 +
* {{GTAG|4817|IDEditor}} &ndash; By {{U|Xmen}}
 +
* {{GTAF|402942|IDE-IV in GTA-IV script centre}} &ndash; by {{U|Gforce}}
 +
* [http://www.aschratt.com/fileview.php?file=1004 FlagValue Calculator] &ndash; By {{U|Aschratt}} - Calculates all flagvalues (even those unknown).
  
===OBJS===
+
== See also ==
  
''GTA IV format''
+
* [[Item placement]]
 +
* [[Map system]]
 +
* [[Dynamic Object]]
  
ModelName, TextureName, DrawDistance, Flag1, Flag2, (Bounds min)X, Y, Z, (Bounds max)X, Y, Z, (Bounds Sphere)X,Y,Z, Radius, WDD
+
== References ==
  
;ModelName: name of the .wdr [[model file]], without extension (string)
+
* {{note|1}} {{GTAF|post|102833|1067607073|Screenshots of flags in GTA III}}
;TextureName: set to 'null' by default in procobj.ide
 
;DrawDistance: [[draw distance]] in [[unit]]s, one for each sub object (float)
 
;Flag1: object flag, defining special behavior
 
;Flag2: object flag, defining special behavior, default 0 (integer)
 
;Bounds Min: Lower Left vertex of a model bounding box
 
;Bounds Max: Upper Right vertex of a model bounding box
 
;Bounds Sphere: X,Y,Z Coords
 
;Radius: Of Bounds Sphere
 
;WDD: set to 'null' by default in procobj.ide
 
  
==Tools==
+
== External links ==
* {{GTAG|4817|IDEditor}} - By {{U|Xmen}}
 
* {{GTAF|402942|IDE-IV in GTA-IV script centre }} - by {{U|Gforce}}
 
* [http://www.aschratt.com/fileview.php?file=1004 FlagValue Calculator] - By {{U|Aschratt}} - Calculates all Flagvalues (even those unknown)
 
  
==External Links==
 
 
* {{GTAF|102833|GTAVC IDE Definitions}} - topic by {{U|ODIE}} covering specific details of IDE files in GTA VC
 
* {{GTAF|102833|GTAVC IDE Definitions}} - topic by {{U|ODIE}} covering specific details of IDE files in GTA VC
 
* {{GTAF|118193|GTA3/VC Map File Documentation and Troubleshooting}} - topic by {{U|Opius}} covering general features of IDE files in GTA3 and GTA VC
 
* {{GTAF|118193|GTA3/VC Map File Documentation and Troubleshooting}} - topic by {{U|Opius}} covering general features of IDE files in GTA3 and GTA VC
* {{GTAF|93990|Paths Documentation for SA, VC and GTA3}} - topic by {{U|REspawn}} detailing GTA3's paths
 
 
* [http://gta-worldmods.t-n-network.de/forum/thread.php?threadid=3382 ID Flagvalue Decoding Project] - project to decode all missing flag values
 
* [http://gta-worldmods.t-n-network.de/forum/thread.php?threadid=3382 ID Flagvalue Decoding Project] - project to decode all missing flag values
  
{{N|4|SA}}
+
{{N|V|IV|VCS|LCS|SA|VC|III}}
  
[[Category:Map Formats]][[Category:GTA 3]][[Category:GTA VC]][[Category:GTA SA]][[Category:GTA 4]]
+
[[Category:Map Formats]]

Latest revision as of 23:12, 12 January 2021

Item Definition
IDE Sections:
2DFX AMAT ANIM CARS HIER HAND MLO OBJS
PATH PEDS TANM TOBJ TREE TXDP WEAP

Item definition files, usually identified by the file extension .ide, are used to declare many different aspects for the map system or to specify special behaviour rules for one of the aspects.

Format

The files are plain text, so they can be opened with text editors such as Notepad. They resemble CSV files, but with some extra features.

Comments

Comments are prefixed with the # symbol. Anything after that symbol is ignored, which means that comments can appear on their own lines as well as at the end of other lines:

# This comment has its own line.
data1, 183, 2.2 # This comment is at the end of a line.

Sections

Files are separated into sections with section...end directives:

section_name
# ...
end

Sections are global – multiple files can contribute to them

Data

Data values can be comma- or space-delimited: commas are replaced with spaces when the game reads a line from the file.

# Both are valid:
123, mystring, 22.4
123 mystring 22.4

Additionally, because the game uses sscanf() to parse these files, any number of spaces is read whenever a single space is encountered in the format string in the game code. As such, values can be aligned into columns:

# Identifier     Some value     Another value
  1              a_value        12345
  2              another        67890

Rockstar developers used this alignment ability a lot.

Rules and details

  • The game only reads 256 characters per line. Anything longer will be truncated.
  • Section identifiers and the end string are case-sensitive.
  • The files are ASCII-encoded. The game does not expect non-ASCII characters to appear, so they will likely cause issues.
  • Decimal places in floating-point values must use . as the decimal point character. , would be replaced with a space when read.
  • Any ASCII control characters – anything less than the space character, 0x20 – is replaced with a space when the game reads the character. The same is done for commas.
  • After reading a line, the game re-reads it to find the first character that is not a space or control character. The final line string starts from this character. This is equivalent to trimming the start of the string.
  • In 3D era games, the section identifiers are always 4 characters long. GTA IV largely adheres to this convention, but not always.

Sections

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

Section Supported games Description
objs GTA III Vice City San Andreas GTA IV Defines simple objects. They can be placed into the world through the inst section of the item placement files.
tobj GTA III Vice City San Andreas GTA IV Defines time objects. The section functions similarly to objs but has two additional parameters defining the in-game time range the object can get rendered. These objects can be placed into the world through the inst section of the item placement files.
hier GTA III Vice City San Andreas GTA IV Defines clump objects for use in cutscenes.
cars GTA III Vice City San Andreas GTA IV Defines vehicle objects.
peds GTA III Vice City San Andreas GTA IV Defines pedestrian objects (random NPC's).
path GTA III Vice City (unstable) San Andreas Adds path nodes to defined objects. This section is unstable in Vice City.
2dfx GTA III Vice City San Andreas GTA IV Adds particle effects and simple ped behaviors to defined objects.
weap Vice City San Andreas GTA IV Defines weapon objects.
anim San Andreas GTA IV Defines animated objects. The section functions similarly to objs but has one additional parameter indicating an IFP or WAD animation file to assign an animation to the object. These objects can be placed into the world through the inst section of the item placement files.
txdp San Andreas GTA IV Used to virtually extend texture dictionaries.
tanm GTA IV Used to combine tobj and anim sections.
Those objects get placed inside the inst section of the WPL.
tree GTA IV (not functional) This section is not functional.
vnod GTA IV
link GTA IV
mlo GTA IV Used to create interiors. This section does also contain information about portals (previous enex connections) and dimensions of the interior which influences certain aspects, like the weather, for example. All objects are placed relative to an offset placed using mlo+ inside the IPL or WPL file.
amat GTA IV This is Audio Materials. Possible Used to make a sound effect at the model. Usually used for dynamic objects.
lodm GTA IV (not functional) This section is not functional.
agrps GTA IV
hand VC Xbox/Mobile

IDE Flags

Flags are used in order to specify the behaviour of objects. They are interpreted as signed 32-bit integer values where each bit describes a boolean value of a different aspect.

GTA III GTA III

Bits Dec Hex Name Description Examples
0 1 0x1 - Cull model if player doesn't look at it? Read, but ignored. Fences
1 2[1] 0x2 DO_NOT_FADE Do not fade the object when it is being loaded into or out of view. Some lampposts
2 4[1] 0x4 DRAW_LAST Model is transparent. Render this object after all opaque objects, allowing transparencies of other objects to be visible through this object. Trees
3 8 0x8 ADDITIVE Render with additive blending. Previous flag must be enabled too.
4 16[1] 0x10 IS_SUBWAY Model is a tunnel, i.e. set the object as invisible unless the player enters cull zone flag 128. This flag works only with static models. Tunnels, some dynamic objects
5 32 0x20 IGNORE_LIGHTING Don't use static lighting, we want dynamic if it's possible. Some lampposts and trafficlights
6 64[1] 0x40 NO_ZBUFFER_WRITE Model is a shadow. Disable writing to z-buffer when rendering it, allowing transparencies of other objects, shadows, and lights to be visible through this object. Not implemented in the PS2 version. Shadow

Vice City GTA Vice City

Bits Dec Hex Name Description Examples
0 1 0x1 IS_ROAD Identifies objects to draw "wet reflections" on them. Roads
1 2 0x2 DO_NOT_FADE Do not fade the object when it is being loaded into or out of view. Some night objects, North Point Mall
2 4 0x4 DRAW_LAST Model is transparent. Render this object after all opaque objects, allowing transparencies of other objects to be visible through this object. Fences, trees
3 8 0x8 ADDITIVE Render with additive blending. Previous flag will be enabled automatically. Night windows
4 16 0x10 - Read, but not used. _dy, _dt objects
5 32 0x20 IGNORE_LIGHTING Don't use static lighting, we want dynamic if it's possible. Interior objects
6 64 0x40 NO_ZBUFFER_WRITE Model is a shadow. Disable writing to z-buffer when rendering it, allowing transparencies of other objects, shadows, and lights to be visible through this object. Tree shadows
7 128 0x80 DONT_RECEIVE_SHADOWS Do not draw dynamic shadows on this object. Small objects, pickups, lamps, trees
8 256 0x100 IGNORE_DRAW_DISTANCE Ignore draw distance for this object (sets its "level" (island id) to 0). LOD models, North Bridge
9 512 0x200 IS_GLASS_TYPE_1 Breakable glass type 1: glass object changes its textures when breaking. Small windows
10 1024 0x400 IS_GLASS_TYPE_2 Breakable glass type 2: glass object doesn't change its textures when breaking. Large windows

Reference table

Bits Dec Hex Name Model info flag Ref address Ref description
0 1 0x1 IS_ROAD 0x04 0x4CA1D7 CRenderer::RenderRoads()
if (CModelInfo::GetModelInfo(entity->m_nModelIndex)->m_nFlags & IS_ROAD)
    entity->Render();
1 2 0x2 DO_NOT_FADE 0x20 0x4C7E03 CRenderer::ShouldModelBeStreamed(CEntity *,CVector const&)
if (model->m_nFlags & DO_NOT_FADE) {
    if (distance >= model->GetLargestLodDistance() + 30.0f)
        return true;
}
else if ( distance >= model->GetLargestLodDistance() + 50.0f)
    return true;
2 4 0x4 DRAW_LAST 0x40 0x56F4F3 CSimpleModelInfo::SetupBigBuilding(int,int)
if (model->m_nFlags & DRAW_LAST) {
    model->m_nFlags &= ~DRAW_LAST;
    dbgprint("%s was draw last\n", model->m_szName);
}
3 8 0x8 ADDITIVE 0x80 0x582590 CVisibilityPlugins::RenderFadingAtomic(RpAtomic *,float)
if (model->m_nFlags & ADDITIVE)
    RwRenderStateSet(rwRENDERSTATEDESTBLEND, rwBLENDONE);
4 16 0x10 - 0x100 - -
5 32 0x20 IGNORE_LIGHTING 0x200 0x56F7C4 CSimpleModelInfo::SetAtomic(int,RpAtomic *)
if (model->m_nFlags & IGNORE_LIGHTING)
    atomic->geometry->flags &= ~rpGEOMETRYLIGHT;
6 64 0x40 NO_ZBUFFER_WRITE 0x400 0x581390 CVisibilityPlugins::RenderFadingEntities(CLinkList<CVisibilityPlugins::AlphaObjectInfo> &)
if (model->m_nType == MODEL_INFO_SIMPLE && model->m_nFlags & NO_ZBUFFER_WRITE)
    RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, FALSE);
7 128 0x80 DONT_RECEIVE_SHADOWS 0x800 0x48AF21 CFileLoader::LoadObjectInstance(char const*)
if (model->m_nFlags & DONT_RECEIVE_SHADOWS)
    entity->m_nFlags.bDontCastShadowsOn = true;
8 256 0x100 IGNORE_DRAW_DISTANCE 0x1000 0x487CDE CEntity::SetupBigBuilding()
if (model->m_afLodDistances[0] > 2500.0f || model->m_nFlags & IGNORE_DRAW_DISTANCE)
    entity->m_nLevel = 0;
9 512 0x200 IS_GLASS_TYPE_1 0x2000 0x488CCD CEntity::PreRender(), probably in-lined CModelInfo::IsGlassModel(int) @0x488CAA
bool CModelInfo::IsGlassModel(int modelId) {
    CBaseModelInfo *model = CModelInfo::GetModelInfo(modelId);
    if (model->m_nType == MODEL_INFO_SIMPLE || model->m_nType == MODEL_INFO_TIME) {
        CSimpleModelInfo *simpleModel = reinterpret_cast<CSimpleModelInfo *>(model);
        return simpleModel->m_nFlags & IS_GLASS_TYPE_1 || simpleModel->m_nFlags & IS_GLASS_TYPE_2;
    }
    return false;
}
10 1024 0x400 IS_GLASS_TYPE_2 0x4000 0x488CE7 CEntity::PreRender()
if (CModelInfo::IsGlassModel(modelId)) {
    if (!(CModelInfo::GetModelInfo(modelId)->m_nFlags & IS_GLASS_TYPE_2) ) {
        CGlass::AskForObjectToBeRenderedInGlass(entity);
        entity->m_nFlags.bIsVisible = false;
    }
}

San Andreas GTA San Andreas

Bits Dec Hex Name Description Examples
0 1 0x1 IS_ROAD This model is a road. Roads
1 2 0x2 - Not read, but present in IDE files.
2 4 0x4 DRAW_LAST Model is transparent. Render this object after all opaque objects, allowing transparencies of other objects to be visible through this object. Fences, trees
3 8 0x8 ADDITIVE Render with additive blending. Previous flag will be enabled automatically. Night windows
4 16 0x10 - Not read, not present in IDE files. -
5 32 0x20 Works only with animated objects ('anim' section in IDE). Doors
6 64 0x40 NO_ZBUFFER_WRITE Disable writing to z-buffer when rendering this model, allowing transparencies of other objects, shadows, and lights to be visible through this object. Shadows, lights
7 128 0x80 DONT_RECEIVE_SHADOWS Do not draw shadows on this object. Small objects, pickups, lamps, trees
8 256 0x100 - Not read, not present in IDE files. -
9 512 0x200 IS_GLASS_TYPE_1 Breakable glass type 1 (additional parameters defined inside the object.dat file, otherwise there is no effect) Small windows
10 1024 0x400 IS_GLASS_TYPE_2 Breakable glass type 2: object first cracks on a strong collision, then it breaks (does also require object.dat registration). Large windows
11 2048 0x800 IS_GARAGE_DOOR Indicates an object as an garage door (for more information see GRGE – requires object.dat registration). Garage doors
12 4096 0x1000 IS_DAMAGABLE Model with ok/dam states. Vehicle upgrades, barriers
13 8192 0x2000 IS_TREE Trees and some plants. These objects move on wind. Trees, some plants
14 16384 0x4000 IS_PALM Palms. These objects move on wind. Palms
15 32768 0x8000 DOES_NOT_COLLIDE_WITH_FLYER Does not collide with flyer (plane or heli). Trees, street lights, traffic lights, road signs, telegraph pole
16 65536 0x10000 - Not read, but present in IDE files. Explosive things
17 131072 0x20000 - Not read, but present in IDE files. chopcop_ models
18 262144 0x40000 - Not read, but present in IDE files. pleasure-DL.dff
19 524288 0x80000 - Unused special object type. Read, but not present in IDE files. -
20 1048576 0x100000 IS_TAG This model is a tag. Object will switch from mesh 2 to mesh 1 after getting sprayed by the player. Tags
21 2097152 0x200000 DISABLE_BACKFACE_CULLING Disables backface culling – as an result the texture will be drawed on both sides of the model. Roads, houses, trees, vehicle parts
22 4194304 0x400000 IS_BREAKABLE_STATUE Object with this model can't be used as cover, i.e. peds won't try to cover behind this object. Statue parts in atrium

GTA IV GTA IV

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

Difference between GTA III and GTA IV engines

GTA IV not only uses different formats to the previous games, it also does not use IDs to identify objects anymore. While GTA III era games use an ID as an index inside an array of definitions, GTA IV uses the hashes of the model name as a key inside a hash table. For more information about this see Map system.

Tools

See also

References

External links