AI Builder
AI builder
The AI builder allows you to quickly build large transport networks in a few clicks. It has over 25,000 lines of code and a fuzzy-logic based route finding algorithm.
Local bus services
Whenever the AI builder constructs a train station, ship port or airport, it will also construct a bus station with three lines to connect the town’s residential, industrial and commercial areas.
Passenger Trains
You can build inter-city passenger train connections, it will look for existing stations and extend existing lines where possible.
New terminals are automatically added, and all existing routes are shifted to make way for the new connection.
Cargo Trains
Cargo routes share tracks were possible. They will not however, use passenger tracks as these are kept seperate.
Trucks and roads
The AI builder looks to re-use existing roads where possible, and upgrade them. It will even take the original street network and "smooth" it out, the effect is subtle, but it mostly allows road vehicles to maintain their top speed.
As of version 1.0 trucks are the only vehicle that will deliver "final" stage cargo to towns.
Highways
There is an option to build highways between cities. I recommend the "2 lane elevated" option, as building ground level highways often end up conflicting with a lot of other things. If two highways cross then a junction (4 way stack interchange) is built automatically.
Ships
Options to connect ships with passenger and freight are provided. Bear in mind there is no way to currently validate a connection until it has been built so sometimes these will fail and need to be rolled back, but I esimate they are successful about 90% of the time.
Air
Passenger air connections are also possible. As of version 1.0 there is no support for cargo freight.
Special features:
Era-specific parameters:
The building parameters change through the eras, I have sub-divided them into 6 different eras roughly dividing the original eras. As time goes on the behaviour will change, for example rail-road grade-crossings are allowed in the early game but not in the late game. The early routes will focus on keeping level, later era routes will focus on keeping straight and minimising distance.
Spirals
If a large height difference is needed that would exceed the configured max gradient then spiral(s) will be built to allow height to be gained or lost. These are fully integrated into the terrain.
Mods
Currently the AI Builder only uses and understands vanilla assets. Unfortunately I had to hard code the production chains so non-vanilla industries will be ignored.
If you want to use non-vanilla stations, then it is possible to build stations in advance and the AI builder will connect these stations with a route. I have provided options for building "elevated" and "underground" route building and these work with the modded elevated and underground stations. However, the AI builder is not able to do any upgrades to modded stations, such as adding tracks or electrification, so this will need to be done by hand.
Caution!
I have seen a lot of crashes to desktop trying to get this to work! Save your games regularly and always make a save before beginning a new AI construction.
Update version 1.1
– added support for delivering cargo to towns with trains
– added support for mod industries
– added a new panel to manage transit within towns
Update version 1.2
– added support for trans-shipment of items using cargo ships, trucks will now extend the range of harbours making water transport more useful
Update version 1.3
– added a customisation button to allow some route choices to be made, including restricting traction types and allowing more track sharing
– new feature – grade seperated track junctions. This will be enabled by default in the late-Era-C period (game year 2000 onwards), but can be customised by choosing options in the new menu
Update version 1.4
– added a button on the rail/town panel to choose whether to build a terminus and override the default selection
– new feature – it is now possible to extend passenger rail lines from non-adjacent terminals, it will build a new grade seperated crossover
– new feature – merging two passenger rail lines into one where a connection is build between stations that act as a start/end point for two lines
Update version 1.5
– new feature – Cargo aircraft! It works a bit differently to the other cargo transport modes as it requires using a pre-existing airport (it will not build airports), instead it will extend the airport at the back with cargo loading facilites on a 2nd taxiway, along with a cargo loading station for trucks. The cargo will be trans-shipped by road to destinations up to 4km away.
Update version 1.6
– new feature – Can now setup a town bus network independently from building a station, this is available in the towns panel
– new feature – Upgrades panel, allows specific upgrades to be made to individual lines. Currently this is only for adding bus lanes and converting bus to tram and vice versa, but more will be added later
Update version 1.7
– new feature – Now supports the "Elevated Stations" mod by Lollus, if you have the mod installed and select the "elevated" option when building passenger lines then these stations will be used automatically for non-terminus station
– new feature – Route planner for passenger lines, can now build a multi-station line in one go by clicking on the towns. This even allows for quadruple track with express and local services!
Update version 1.8
– new feature – Now supports the "Underground Stations" mod that I created. If you have the mod installed and select the "underground" option when building train lines then these stations will be used automatically for non-terminus station.
– new feature – Route planner for highways – it is now possible to setup highway connections between multiple cities in one go
Update version 1.9
– new feature – A new "straighten" panel to allow you to straighten out tracks, roads and highways to allow faster speeds
Update version 1.10
– fix bug to do with global assignment
– fix bug trying to build depot connection
Update version 1.11
– fix bugs that cause tracks/road to be built through each other
– add feature to directly set the vehicle climate option (auto detect remains the default but not always correctly identifies the vehicle set in use)
– add feature to allow "favourite" vehicles to restrict what the AI builder will buy to a user-defined list
– update to suppress use of "legacy" vehicle models where newer versions are available
Update version 1.12
– numerous bug fixes
– improvements to route finding
– better logic around placement of train stations
– improved support for the multi terminal feature
Update version 1.13
– many bug fixes and optimisations
– add feature to use a "map mode" to choose new connections
Update version 1.14
– a number of quality improvments and several bugs fixed
– new feature to support 400m platforms
Update version 1.15
– a major focus on fixing bugs
– rework the way water routes are setup to make it more likely to be successful
Update version 1.16
– new feature, with the help of an LLM I have created translations for all of the languages supported by TPF2
– some other improvements and bug fixes
Revisions:
Old revisions of this mod are available below. Click the link to download.