Repository navigation
Route Types
The type of A3D_FindRoute and the other route natives is an A3D_ROUTE, which tells which paths a route uses and how it weighs them.
| Type | Value | Paths | One way streets | Best route |
|---|---|---|---|---|
A3D_ROUTE_FASTEST |
0 |
Every road | Kept | The least time |
A3D_ROUTE_SHORTEST |
1 |
Every road | Kept | The least distance |
A3D_ROUTE_ANY_WAY |
2 |
Every road | Driven both ways | The least time |
A3D_ROUTE_TRAFFIC |
3 |
The roads the traffic of the game drives | Kept | The least time |
A3D_ROUTE_BOAT |
4 |
The lanes for boats | Sailed both ways | The least time |
A3D_ROUTE_WALK |
5 |
The paths of pedestrians, and the roads where there are none | Walked both ways | The least time |
The time of a route, which A3D_GetRouteTime gives and the routes that weigh time compare, comes from these speeds:
| Path | Speed |
|---|---|
| Highway | 36 metres a second, 130 km/h |
| Road the traffic drives | 22 metres a second, 79 km/h |
| Road the traffic leaves alone | 14 metres a second, 50 km/h |
| Lane for boats | 15 metres a second, 54 km/h |
| On foot | 5 metres a second, 18 km/h |
A walk along a road weighs a quarter more than along a path for pedestrians, and along a highway two and a half times more, so walks keep to the paths where they can. The time still counts them at 5 metres a second.
The routes for vehicles also pay for their turns at junctions: two seconds to the right, five to the left and thirty to turn back. A3D_ROUTE_SHORTEST pays only for turning back, as 100 metres. Boats and walks turn at no cost. See Turns.
-
A3D_ROUTE_FASTESTis what a player driving expects from a GPS. -
A3D_ROUTE_SHORTESTsuits a runner or a fare by distance, and takes small roads to save metres. -
A3D_ROUTE_ANY_WAYsuits the police, the ambulance and the fire brigade. -
A3D_ROUTE_TRAFFICsuits vehicles driven by scripts, which should stay on the main roads. -
A3D_ROUTE_BOATkeeps to the water, between the lanes the boats of the game sail. -
A3D_ROUTE_WALKleads a player on foot, and with the navigation mesh from and to any point.
3DAndreas 0.7.1 · Repository · Releases · MIT License
Guides
- Installation
- Configuration
- Physics objects
- Model settings
- World queries
- The screen
- Routes
- Navigation mesh
- Map database
- Coming from ColAndreas
- Performance
Reference
Functions