Definition of paths.ipl for GTA Vice City

Basic Terms

Being able to use the same technical terms as everyone else makes discussing your paths with other people easier, so you can work with other people and help each other out much easier. I think the most sensible way to describe them is like this:

Node
A single point. Uses a 3-dimensional coordinate in precision units, which are sixteen times smaller than standard units. A standard unit is about one meter long.
Null Node
A point which is ignored by the game. It is used to ensure there are always twelve nodes in each group.
Internal Node
A point which links to another point in the current group.
External Node
A point which links to an external node in one or more other groups. The link is only made when these external nodes are in exactly the same position.
Link
The straight line between two nodes in a group.
The continuation of one group into another using external nodes.
Group
A set of twelve nodes with an identifier.
Identifier
Indicates the start of a group and makes the group spawn boats, vehicles or pedestrians (peds).
Path
Any number of groups which are linked together using external nodes.
Comment
By placing a hash (#) character at the start of a line, that line is ignored by GTA Vice City and so you can type anything on it.

The rest of this document goes into exhausting detail about nodes, groups and paths. It includes examples and diagrams but these are for illustrative purposes only; the example paths will not work well in GTA Vice City. You cannot add path data to the paths.ipl file without deleting some or all of the original paths first.

Single Node Definition

Each node requires the twelve parameters shown here:

	Type, Next, 0, X, Y, Z, Median, Left, Right, Flag1, Flag2, Flag3

Nodes must have a TAB character (ASCII 09) at the start or the game will not load.

What the parameters basically do is described here:

Node Parameters
Unit Value Descriptions
Type Integer 0 Null node.
1 External node.
2 Internal node.
Next Integer -1 Do not link to any other node in this group.
0 to 11 Link to this node number in this group.
0 Integer 0 Seems to have no function.
X Precision Distance -25000 to 25000 Position of node East from environment center.
Y Position of node South from environment center.
Z -16000 to 25,000 Position of node upwards from environment center.
Median Precision Distance 0 or more For vehicles: Width of the divider between left lanes and right lanes.
For peds: Width of the line they walk down.
For boats: Unknown purpose.
Left Integer 0 or more Number of traffic lanes to the left of this node.
Right Integer 0 or more Number of traffic lanes to the right of this node.
Flag1 Decimal 0 No Flag1 features.
1 Unknown Purpose.
2 Unknown Purpose.
Flag2 Decimal 0 No Flag2 features.
1 Prevents normal vehicles from spawning.
2 If a vehicle node, it will now create a roadblock.
4 Unknown purpose.
8 Unknown purpose.
Flag3 Decimal 0 No Flag3 features.
0.2 Unknown purpose.
0.3 Unknown purpose.
0.4 Unknown purpose.
0.5 Unknown purpose.
1 Unknown purpose.

Single Group Definition

Sets of twelve nodes are contained in a group, as defined here:

Object, -1
	Type, Next, 0, X, Y, Z, Median, Left, Right, Flag1, Flag2, Flag3
	Type, Next, 0, X, Y, Z, Median, Left, Right, Flag1, Flag2, Flag3
	Type, Next, 0, X, Y, Z, Median, Left, Right, Flag1, Flag2, Flag3
	Type, Next, 0, X, Y, Z, Median, Left, Right, Flag1, Flag2, Flag3
	Type, Next, 0, X, Y, Z, Median, Left, Right, Flag1, Flag2, Flag3
	Type, Next, 0, X, Y, Z, Median, Left, Right, Flag1, Flag2, Flag3
	Type, Next, 0, X, Y, Z, Median, Left, Right, Flag1, Flag2, Flag3
	Type, Next, 0, X, Y, Z, Median, Left, Right, Flag1, Flag2, Flag3
	Type, Next, 0, X, Y, Z, Median, Left, Right, Flag1, Flag2, Flag3
	Type, Next, 0, X, Y, Z, Median, Left, Right, Flag1, Flag2, Flag3
	Type, Next, 0, X, Y, Z, Median, Left, Right, Flag1, Flag2, Flag3
	Type, Next, 0, X, Y, Z, Median, Left, Right, Flag1, Flag2, Flag3

The identifier (Object, -1) does not need a TAB or any indent. What it needs and what it does is:

Unit Values Description
Object Integer 0 Peds.
1 Cars and trucks.
2 Boats.
-1 Integer -1 Seems to be a simple delimiter because -1 is always used.

Example 1: Order and Position

GTA Vice City decides the first node shall be number zero and so the last node is number eleven. There will always be at least two external nodes so that the group has one start point and one end point. I recommend external nodes be placed at the bottom of each group with internal nodes at the top. Any gap between internal and external nodes must be filled with null nodes to always have twelve nodes per group.

The Next value means which node the current node should lead to. So, if you have an external node in position ten it might point to node zero by setting 0 as the Next value.

The best way to explain how nodes link to each other inside a group is a simple example:

0 -1
	1, 01, #, 400, 200, 100, #, #, #, #, #, #
	1, 02, #, 300, 300, 100, #, #, #, #, #, #
	1, 03, #, 300, 400, 100, #, #, #, #, #, #
	1, 11, #, 400, 500, 100, #, #, #, #, #, #
	0, -1, #, 000, 000, 000, #, #, #, #, #, #
	0, -1, #, 000, 000, 000, #, #, #, #, #, #
	0, -1, #, 000, 000, 000, #, #, #, #, #, #
	0, -1, #, 000, 000, 000, #, #, #, #, #, #
	0, -1, #, 000, 000, 000, #, #, #, #, #, #
	0, -1, #, 000, 000, 000, #, #, #, #, #, #
	2, 00, #, 500, 200, 100, #, #, #, #, #, #
	2, -1, #, 500, 500, 100, #, #, #, #, #, #

In this example I have used the hash (#) character for all parameters that I will not be referring to.

Order

In the middle of the group is a set of eight nodes which have 0 at the start. This indicates they are null nodes and will not be used to create objects. There are only four nodes in this group which will actually do anything.

Nodes ten and eleven are set as type 1 which means they are external. If there is any other group which has an external node at the same location, a link will be created between these two groups at that position.

If we try to read through the group, we should start at node ten. The value for the Next parameter is 00 which means node number zero. A straight line is used between node ten and node zero as the path. Then, node zero has a Next value of 01 which means another straight section is added between node zero and node one. Node one then links to node two, which then links to node three.

Node three does not have a next value of 04 because node four is a null node. Instead it has a Next value of 11 so the final part of this group is made between node three and node eleven. Node eleven has a next value of -1 which tells the game that it there are no more links to be made in this group.

Position

Now that you know the order these nodes link to each other, we will look at their positions. After the Next parameter is 0,  and after that are the X, Y and Z parameters. I have used simple values for for these so you can draw where the nodes are quite simply. To save you the trouble, I have done it here:

Example 1

I have shown the external nodes in red and the internal nodes in blue, with the node number in the same colour. The thick black lines between the nodes show how they are linked up due to the Next attribute. The numbers across the top show are for the X parameter and the numbers down the side are for the Y parameter.

Example 2: Linking Groups

I have shown how a group of nodes can create a short path in the shape of a C character. Now I will show how this simple character can be extended by making another group. The group will be a dead end (also known as a cul-de-sac or terminating road) to keep the example simple. The new group we will add is this:

# Group B
0 -1
	1, 01, 0, 600, 200, 100, #, #, #, #, #, #
	1, 02, 0, 600, 100, 100, #, #, #, #, #, #
	1, 03, 0, 700, 200, 100, #, #, #, #, #, #
	1, 04, 0, 700, 300, 100, #, #, #, #, #, #
	1, 05, 0, 600, 300, 100, #, #, #, #, #, #
	1, 06, 0, 600, 400, 100, #, #, #, #, #, #
	1, 07, 0, 700, 400, 100, #, #, #, #, #, #
	1, 11, 0, 700, 500, 100, #, #, #, #, #, #
	0, -1, 0, 000, 000, 000, #, #, #, #, #, #
	0, -1, 0, 000, 000, 000, #, #, #, #, #, #
	2, 00, 0, 500, 200, 100, #, #, #, #, #, #
	2, -1, 0, 600, 500, 100, #, #, #, #, #, #

This time there are only two null nodes but there are still two external nodes at the bottom. Node number ten in this Group B is at (500,200) and is an external node. In Group A there is an external node at (500,200) as node number eleven. Because these two external nodes (A11 and B10) are in the same physical location, they continue the path between the two groups.

The resulting path can be shown like this:

Example 2

Example 3: Junctions

A simple crossroad junction will be quite straightforward to set up even if there is a median or a four lane road is being crossed by a two lane road. However, if you have a custom landscape with realistic junctions they can become quite complicated. Our examples have created a two lane road in an oval. Now I will show how a junction could be made between this oval and another road to the south of it, which is relatively simple.

You should always start by making the junction pieces and then link up the gaps with extra groups later on. The centre of the junction onto the new road will be at (500,800) and so we need to add a internal node there in a new Group C. We will then add an external node at (400,800) for the new road to go West from and another at (600,800) for the new road to go east.

We will then add another external node at (500,700) to add the North option to the junction. An internal node at (500,600) will continue to head North towards Group A and a final external node at (500,500) will actually link with node A11 to complete the path.

This is actually a bit complicated. The data required to do it is shown here:

# Group C
0 -1
	1, 09, 0, 500, 600, 100, #, #, #, #, #, #
	1, 10, 0, 500, 800, 100, #, #, #, #, #, #
	0, -1, 0, 000, 000, 000, #, #, #, #, #, #
	0, -1, 0, 000, 000, 000, #, #, #, #, #, #
	0, -1, 0, 000, 000, 000, #, #, #, #, #, #
	0, -1, 0, 000, 000, 000, #, #, #, #, #, #
	0, -1, 0, 000, 000, 000, #, #, #, #, #, #
	2, 00, 0, 500, 500, 100, #, #, #, #, #, #
	2, 01, 0, 500, 700, 100, #, #, #, #, #, #
	2, 01, 0, 400, 800, 100, #, #, #, #, #, #
	2, 01, 0, 600, 800, 100, #, #, #, #, #, #

This group starts at external node nine which is at position (500,500). You might remember that external node A11 is at this location too, meaning that Group A is linked to Group C here. Node nine goes to node zero, which is an internal node just to the south of the start node. It then leads to external node ten, which is on the North edge of the actual junction. This node then links to node one, which is the internal node at the center of the junction (500,800).

Node ten is on the West edge of the junction and node eleven is on the East edge of the junction. They both link to the center node, node one.

The new Group C has now extended our path created by groups Group A and Group B into this:

Example 3

You could now add a new Group D to extend the junction Eastwards from C10 and a new Group E to extend the junction Westwards from C11 if you wanted. You would need to add another external node in Group C from node C1 to extend the route southwards using another group.

Example 4: Traffic Lights

Traffic lights are actually operated by the traffic light models and not by the paths data. By placing these traffic light objects at your junction, they make the vehicle AI stop when they reach an exit node near a traffic signal which is red. If the signal is green, they drive through the junction as normal. If it is flashing yellow, they treat it like a normal junction.

Further Reading

You can find my manual path editing guide to see how you can create a new pedestrian path to El Swanko Casa. There are some modding programs which can create paths for you but you need to understand how paths work in order to use them.

You can download the diagrams as bitmaps in a 10.3kB WinRAR archive.