Difference between revisions of "Paths (GTA4)"
m (→Header) |
|||
(22 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{File-stub}} |
− | |||
Paths in [[GTA_4|GTA IV]] are similar to the 64 node-files introduced with [[GTA_SA|San Andreas]]. Like the first version of the format there are 64 node files where each file corresponds to a 750x750 square unit starting with <code>nodes0.nod</code> in the south-west corner (-3000.0, -3000.0) and ending in the north-east corner (3000.0, 3000.0) of the game's world in [[Wikipedia:row-major order|row-major order]]. | Paths in [[GTA_4|GTA IV]] are similar to the 64 node-files introduced with [[GTA_SA|San Andreas]]. Like the first version of the format there are 64 node files where each file corresponds to a 750x750 square unit starting with <code>nodes0.nod</code> in the south-west corner (-3000.0, -3000.0) and ending in the north-east corner (3000.0, 3000.0) of the game's world in [[Wikipedia:row-major order|row-major order]]. | ||
==Preamble== | ==Preamble== | ||
− | Before | + | Before trying to understand the format of GTA IV's path files, it is recommended to read the [[Paths (GTA SA)|San Andreas paths]] article, since GTA IV paths are an update of the old format. |
− | Unlike San Andreas paths are not stored in the major | + | Unlike San Andreas, paths are not stored in the major [[archive file]] ([[gta3.img]]) and the node files also do not have the extension <code>.dat</code> anymore. In GTA IV, paths are stored in the <code>~\pc\data\cdimages\paths.[[img]]</code> file as 64 <code>.nod</code> files. Furthermore the file structure has generally changed: If San Andreas had 7 sections per node file, GTA IV only got 2. Linking works in a different way and there are no navi nodes any longer. |
− | + | {{Incomplete}} | |
==File Format== | ==File Format== | ||
Line 28: | Line 27: | ||
4b - UINT32 - Number of links ([[Paths_(GTA4)#Section_2_-_Links|section 2]]) | 4b - UINT32 - Number of links ([[Paths_(GTA4)#Section_2_-_Links|section 2]]) | ||
− | + | {{Incomplete}} | |
===Section 1 - Nodes=== | ===Section 1 - Nodes=== | ||
Line 36: | Line 35: | ||
2b - UINT16 - Area ID | 2b - UINT16 - Area ID | ||
2b - UINT16 - Node ID | 2b - UINT16 - Node ID | ||
− | 4b - UINT32 - Unknown | + | 4b - UINT32 - Unknown - may be related into [[GTA_SA_Paths#Section_2_-_Navi_Nodes|interpolation]] |
− | 2b - UINT16 - | + | 2b - UINT16 - Heuristic Cost - Used for calculating shortest route internally |
2b - UINT16 - LinkID | 2b - UINT16 - LinkID | ||
6b - INT16[3] - Position (XYZ) | 6b - INT16[3] - Position (XYZ) | ||
− | 1b - BYTE - Path Width | + | 1b - BYTE - Path Width |
− | 1b - BYTE - | + | 1b - BYTE - FloodFill - seperates nodes distinctly (need confirmation) |
4b - UINT32 - Flags | 4b - UINT32 - Flags | ||
− | + | ;Area ID: defines the area where the node lays in. Usually this is the same number as the one of the node file. | |
− | + | ;Node ID: defines the id of the node. This is important for linking the node to others. Using the node and area id nodes can be identified as unique. There cannot be 2 nodes with the same area ''and'' node id. | |
+ | |||
+ | ;Link ID: points to an link in section 2. The link ID cannot point into another node file. It points to a link in the same node file. However this link is able to point to an node in another or the same area. | ||
+ | ;Position (X,Y,Z): The world-coordinates of the node. To get the floating point X and Y coordinates divide the 16 bit integer by 8. For Z coords you have to divide by 128 (Unlike San Andreas). | ||
+ | ;Path Width: used to set the width of the paths. For cars this is related in how much space there is between 2 lanes. Divide the 8 bit unsigned integer by 8 to get the floating point value. | ||
+ | ;Path Type: descripes the type of an node. This is used to isolate certain nodes from others. For boats this is allways 0x01. | ||
+ | ;Flags: the flags are used to influence the behaviour of non-person-characters (NPC's), which are spawned along the paths on the nodes (See below). | ||
+ | |||
+ | '''Note:''' Please note that this is in little-endian format. | ||
+ | ====Path Node Flags==== | ||
+ | |||
+ | Flag 0: Unknown but used | ||
+ | Flag 1-2: Unknown | ||
+ | Flag 3: Dont Wander | ||
+ | Flag 4: Ignored? | ||
+ | Flag 5: Emergency Only? | ||
+ | Flag 6: isWaterNode | ||
+ | Flag 7: Unknown | ||
+ | |||
+ | Flag 8: Ignored Node? | ||
+ | Flag 9-11: SpeedLimit? | ||
+ | Flag 12-15: Link Count | ||
+ | |||
+ | Flag 16: Disable Linking? | ||
+ | Flag 17: Slow Trafiic | ||
+ | Flag 18: Highway | ||
+ | Flag 19: Dirt Road | ||
+ | |||
+ | '''Note:''' Flag 'Slow Traffic' make the average car speed = 30 KM/H; 'Highway' = 70 KM/H; Dirt Road = 50(?) KM/H. | ||
+ | Speed Value may be wrong, but these three flags are fully known. | ||
+ | |||
+ | Flag 20: Unknown Ped Flag | ||
+ | Flag 21: Boat Movement | ||
+ | Flag 22: Unknown | ||
+ | Flag 23: Using only in Manhat? | ||
+ | |||
+ | Flag 24-27: Behaviour | ||
+ | Flag 28-31: Spawn Rate? | ||
===Section 2 - Links=== | ===Section 2 - Links=== | ||
Line 51: | Line 87: | ||
2b - UINT16 - Area ID | 2b - UINT16 - Area ID | ||
2b - UINT16 - Node ID | 2b - UINT16 - Node ID | ||
− | + | 1b - UINT8 - Unknown | |
+ | 1b - UINT8 - Link length | ||
+ | 2b - UINT16 - Flags | ||
+ | |||
+ | * ''Structure unconfirmed and partially incomplete'' | ||
+ | |||
+ | {{Incomplete}} | ||
− | + | ==Tools and Scripts== | |
− | * | + | * {{GTAF|392955|PathViewer}} – a tool by {{U|Aschratt}} which allows to view paths and highlight nodes with special flags in 3D. |
− | ==External | + | ==External Links== |
− | * | + | * {{GTAF|388886|IV Paths Format}} |
− | + | {{GTA4-navi}} | |
+ | [[Category:Map Formats]][[Category:GTA 4]] |
Latest revision as of 15:22, 4 September 2015
Paths in GTA IV are similar to the 64 node-files introduced with San Andreas. Like the first version of the format there are 64 node files where each file corresponds to a 750x750 square unit starting with nodes0.nod
in the south-west corner (-3000.0, -3000.0) and ending in the north-east corner (3000.0, 3000.0) of the game's world in row-major order.
Contents
Preamble
Before trying to understand the format of GTA IV's path files, it is recommended to read the San Andreas paths article, since GTA IV paths are an update of the old format.
Unlike San Andreas, paths are not stored in the major archive file (gta3.img) and the node files also do not have the extension .dat
anymore. In GTA IV, paths are stored in the ~\pc\data\cdimages\paths.img
file as 64 .nod
files. Furthermore the file structure has generally changed: If San Andreas had 7 sections per node file, GTA IV only got 2. Linking works in a different way and there are no navi nodes any longer.
This section is incomplete. You can help by fixing and expanding it.
File Format
The following data types and structures are used within this article:
- INT8/UINT8 - signed/unsigned 8 bit integer (1 byte)
- INT16/UINT16 - signed/unsigned 16 bit integer (2 byte)
- INT32/UINT32 - signed/unsigned 32 bit integer (4 byte)
- FLOAT - single precision floating point number (4 byte)
Header
The header is a structure of 4 values with a size of 16 bytes.
4b - UINT32 - Number of nodes (section 1) 4b - UINT32 - Number of car-nodes 4b - UINT32 - Number of intersection nodes 4b - UINT32 - Number of links (section 2)
This section is incomplete. You can help by fixing and expanding it.
Section 1 - Nodes
4b - UINT32 - MemAddress 4b - UINT32 - Zero (Allways) 2b - UINT16 - Area ID 2b - UINT16 - Node ID 4b - UINT32 - Unknown - may be related into interpolation 2b - UINT16 - Heuristic Cost - Used for calculating shortest route internally 2b - UINT16 - LinkID 6b - INT16[3] - Position (XYZ) 1b - BYTE - Path Width 1b - BYTE - FloodFill - seperates nodes distinctly (need confirmation) 4b - UINT32 - Flags
- Area ID
- defines the area where the node lays in. Usually this is the same number as the one of the node file.
- Node ID
- defines the id of the node. This is important for linking the node to others. Using the node and area id nodes can be identified as unique. There cannot be 2 nodes with the same area and node id.
- Link ID
- points to an link in section 2. The link ID cannot point into another node file. It points to a link in the same node file. However this link is able to point to an node in another or the same area.
- Position (X,Y,Z)
- The world-coordinates of the node. To get the floating point X and Y coordinates divide the 16 bit integer by 8. For Z coords you have to divide by 128 (Unlike San Andreas).
- Path Width
- used to set the width of the paths. For cars this is related in how much space there is between 2 lanes. Divide the 8 bit unsigned integer by 8 to get the floating point value.
- Path Type
- descripes the type of an node. This is used to isolate certain nodes from others. For boats this is allways 0x01.
- Flags
- the flags are used to influence the behaviour of non-person-characters (NPC's), which are spawned along the paths on the nodes (See below).
Note: Please note that this is in little-endian format.
Path Node Flags
Flag 0: Unknown but used Flag 1-2: Unknown Flag 3: Dont Wander Flag 4: Ignored? Flag 5: Emergency Only? Flag 6: isWaterNode Flag 7: Unknown
Flag 8: Ignored Node? Flag 9-11: SpeedLimit? Flag 12-15: Link Count
Flag 16: Disable Linking? Flag 17: Slow Trafiic Flag 18: Highway Flag 19: Dirt Road
Note: Flag 'Slow Traffic' make the average car speed = 30 KM/H; 'Highway' = 70 KM/H; Dirt Road = 50(?) KM/H. Speed Value may be wrong, but these three flags are fully known.
Flag 20: Unknown Ped Flag Flag 21: Boat Movement Flag 22: Unknown Flag 23: Using only in Manhat?
Flag 24-27: Behaviour Flag 28-31: Spawn Rate?
Section 2 - Links
2b - UINT16 - Area ID 2b - UINT16 - Node ID 1b - UINT8 - Unknown 1b - UINT8 - Link length 2b - UINT16 - Flags
- Structure unconfirmed and partially incomplete
This section is incomplete. You can help by fixing and expanding it.
Tools and Scripts
- GTAForums: PathViewer – a tool by Aschratt which allows to view paths and highlight nodes with special flags in 3D.
External Links
- GTAForums: IV Paths Format
Grand Theft Auto IV | |
---|---|
File Formats | .dat • .gxt • .ide • .img • .ipl • .nod • .sco • .rpf • .rrr • .wad • .wbd/.wbn • .wdd • .wdr • .wft • .whm • .wpl • .wtd |
Documentation | Audio • Bink Video • Cryptography • Cutscenes • GXT Text • Image listing • Keycodes • Map Listing • Native functions • Paths • Radar Blips • Radio Stations • Saves • Scenarios • VTable • Weapons |
Tools | ASI Loader • ENBSeries • G-Texture • GIMS IV • Ingame WPL Editor • IV Needle • OpenIV • SparkIV • XLiveLess • WPL Manager • X Mod Installer Alice • C++ Script Hook • .NET Script Hook • Scocl |
Tutorials | Importing Textures with OpenIV • Importing Textures with SparkIV |
Modifications | GTA Connected • Gostown IV • Four Multiplayer • IV Multiplayer • CitizenMP:IV Reloaded |
Useful links | Community portal • Discussion forums • Modding forums • Mods on GTAGarage.com |