Trainz AI Routing

foristellsteam

New member
I have seen games, such as Run8 that have an automatic dispatch system that will route certain trains around other ones, and I'm wondering if Trainz has a similar system where, for example I have an AI train going 40 MPH and one going 70 MPH behind it both going to the same destination, is there a way to automatically route the faster train around the slower one. If not, I will just continue to have them on autopilot chasing yellow signals. Not the end of the world, but it would be cool if the AI could route itself around the slower train.
 
You might be able to use priority markers. These are found in the track objects menu under the triggers and markers tab in Classic Surveyor and in Surveyor 2.0 in the track objects filter.

Assign the higher priority track you want your faster train to take by placing a priority marker that's been configured for the higher priority and assign your faster AI train the higher priority by clicking on your locomotives with the get properties question mark.
 
Hi

Unfortunately this isn't as simple as it appears. I managed to get a test route with a double track mainline to do this back in TS12.

The slow train in front needs to know when a faster train is coming up behind it. I did this by using variables for the section of track on the approach to a passing loop. As a fast train entered a section of track between two passing loops it set the variable for that section of track to 1. When a slow train approached the next passing loop it would check the variable. If it was set to 0 it would set the path through the passing loop for the main line. If the variable is set to 1 then it would set the path for the siding where the slow train would wait until the variable was returned to 0 by the faster train going past. The slow train would check for the variable to be reset to 0 and when it was it would set the path out from the siding and continue on its way.

This works fine on a double track main line but if it is on a single bidirectional track it gets way more complicated as you also need to indicate if the section beyond the next passing loop is clear so that all trains will know if they need to set the path for the main or the siding. You also need to indicate the direction of travel of that train. This also all needs setting up for trains traveling in either direction. I gave up on it at that point. It could possibly be done but it would probably need to be done in a rule as it's too complicated for the ordinary driver commands for use with variables.

Regards

Brian
 
Back
Top