Difference between revisions of "Paths (GTA4)"

From GTAMods Wiki
Jump to navigation Jump to search
m (Section 2 - Links)
Line 43: Line 43:
 
  1b - BYTE  - Path Type (0x100 for Boats)
 
  1b - BYTE  - Path Type (0x100 for Boats)
 
  4b - UINT32 - Flags
 
  4b - UINT32 - Flags
 +
 +
====Nodeflags====
 +
 +
0-4: unknown
 +
 +
Flag 05: Emergency only
 +
Flag 06: Boats
 +
Flag 07: Unknown
 +
Flag 08: Exactly the same as 05
 +
Flag 09: Intersection central node
 +
Flag 10: Is highway
 +
Flag 11: Is not highway
 +
 +
12-15: Link count
 +
 +
Flag 16: Disable linking
 +
 +
17-23: unknown
 +
 +
Flag 24: Is ped node?
 +
Flag 25: Rarely used, police controls or roadblocks?
 +
Flag 26: unknown ped flag
 +
Flag 27: Unknown ped flag
 +
 +
28-31: unknown
  
 
* ''Structure unconfirmed and partly incomplete''
 
* ''Structure unconfirmed and partly incomplete''

Revision as of 20:53, 14 January 2009

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.

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 lane settings
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

Nodeflags

0-4: unknown
Flag 05: Emergency only
Flag 06: Boats
Flag 07: Unknown
Flag 08: Exactly the same as 05
Flag 09: Intersection central node
Flag 10: Is highway
Flag 11: Is not highway
12-15: Link count
Flag 16: Disable linking
17-23: unknown
Flag 24: Is ped node?
Flag 25: Rarely used, police controls or roadblocks?
Flag 26: unknown ped flag
Flag 27: Unknown ped flag
28-31: unknown
  • Structure unconfirmed and partly incomplete
  • This section is incomplete

Section 2 - Links

2b - UINT16  - Area ID
2b - UINT16  - Node ID
1b - UINT8   - Unknown
1b - UINT8   - Link length
2b - UINT16  - Flags
  • Structure unconfirmed and partly incomplete
  • This section is incomplete

External Link