Search In
• More options...
Find results that contain...
Find results in...

# Route planning with A* algorithm / How are streets referenced in GTA V and the paths.xml?

## Recommended Posts

Dear community,

thanks for all the great information!

I need some clarification regarding the map used in GTA V and the underlying paths.xml file.

http://gta.wikia.com/wiki/Paths_(GTA_V)

But I wonder how to interpret the paths.xml file correctly.

This is my understanding so far:

- The map is represented as a graph with nodes and edges(links).

- Every node corresponds to the beginning of a piece of street/path including only one lane to the next node (or nodes? like at a junction for example when you can enter the junction on one lane but exit it on one of two lanes?)

- The edges(links) describe the attributes of the lanes, like width and type of the lane and since they include two node id's they also describe

Therefore if you have say a four lane road (two in driving direction, two in opposite direction), this corresponds to a total of eight nodes and four egdes(links) between them, right?

Or are only two nodes and four edges(links) sufficient?

What I don't really understand is how everything is referenced.

Is it referenced in a global coordinate frame? Do the (x,y,z) coordinates of a node for example correspond to the middle of every lane? If not, is there an underlying logic where nodes are placed on the real streets (I saw that the nodes sometimes correspond to the middle of a road, sometimes to a lane marking...that makes things complicated).

Ideally, what I want to do is to build a module that uses an A* algorithm for offline route planning purposes. Then I want to drop the car at a location and want the car to follow that exact planned path. Do you think something like that is possible? How difficult could the implementation be?

Best regards,

Manuel

##### Share on other sites

As far as I know, there are separate nodes for each lane so the coordinates show exactly where the nodes are.

The nodes may or may not be in the middle of a lane, because of developers' errors or the need to tell AI drivers where to switch lanes.

The nodes are in the middle because there are attributes defining how many lanes there are for this node.

It is possible to put a node in any location and ask AI to drive to it, but to do that you also need links(e.g. vlink in path.xml) from an existing node to the new node.

I don't know much in terms of coding so hope the above info helps.

Edited by nondin

## Create an account

Register a new account