Road pathfinding

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Post Reply
Morlow
Engineer
Engineer
Posts: 4
Joined: 01 May 2011 04:57

Road pathfinding

Post by Morlow »

Hello all, I am playing a game right now with lots of road vehicles and with one road it was getting really backed up going up hills so I built another road right next to it figuring the trucks would take that instead of just waiting in line on the other road, but they don't. Is there any way to get vehicles to split the load of traffic when it is backed up? Trains are smart enough to take an empty track but I can't figure out how to get trucks to do the same.
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: Road pathfinding

Post by Eddi »

unfortunately, the patch that made trucks avoid busy roads and search for alternative routes never made it to trunk

trains have access to two easy properties that determine whether a track is busy: signals and reservations. trucks/roads don't have these, so it's tricky to replicate the effect. you can't look up all the vehicles on the tiles, as this would be computationally expensive, and you can't easily make reservations, as more than one truck is often on the same tile, so you lose track who reserved what.
HGus
Engineer
Engineer
Posts: 121
Joined: 12 May 2013 22:28
Location: Argentina

Re: Road pathfinding

Post by HGus »

Still trucks are smart enough to avoid roads with busy stations, so you can build double track stations on compromised roads, and when a truck is in the tile with the station (or in the queue), the incoming ones will switch to the road where is the empty station tile (use the station just like a waypoint) Even if there is an alternative route with no station tile, the truck will avoid the station if any other vehicle is in the way.
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 28 guests