Paths (GTA4)
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 you start understanding GTA IV's path format you should start reading San Andreas paths article. Since GTA IV paths are based on the old path version the article is good to understand path basics.
Unlike San Andreas paths are not stored in the major image file (gta3.img). Also nodefiles do not longer have the ending .dat
. In GTA IV paths are stored in the ~\pc\data\cdimages\paths.img
file as 64 .nod
files. Also the file format has changed in general. Where San Andreas had 7 sections per node file GTA IV just got 2. Linking works different and there are no navi-nodes any longer.
This section is incomplete
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
Section 1 - Nodes
4b - UINT32 - MemAddress 4b - UINT32 - Zero (Allways) 2b - UINT16 - Area ID 2b - UINT16 - Node ID 4b - UINT32 - Unknown 2b - UINT16 - Allways 0x7FFE 2b - UINT16 - LinkID 6b - INT16[3] - Position (XYZ) 1b - BYTE - Path Width (divide it by 8 to get the floating point value) 1b - BYTE - Path Type (0x100 for Boats) 4b - UINT32 - Flags
- Structure unconfirmed and partly incomplete
- This section is incomplete
Section 2 - Links
2b - UINT16 - Area ID 2b - UINT16 - Node ID 4b - UINT32 - Flags
- Structure unconfirmed and partly incomplete
- This section is incomplete
External Link
- IV Paths Format - GTAForums topic