Configuring a route to allow bi-directional AI on a single track

philskene

Well-known member
The issue of running bi-directional AI trains on a single track with crossing loops comes up from time to time in these Forums. On youtube I've uploaded other "how to" videos about interactive industries and freight cars. I'm in the process of uploading a sequence of three videos showing how to configure track and portals to make bi-directional AI work.

It's based on about five decades of experience mixed with some anger and much frustration. And bear in mind what a retired Marines General said about hi-tech products - "What most people don't realise is that in actual combat anything more complex than a can opener will not work; and even a can opener will not work all the time." So, please, if you follow my tutorials to the letter it is likely that AI will work for you but it is in no way guaranteed.

OK - Tutorial One - Signals and Track Markers.

A simple route with a single track, three crossing loops and portals to emit and consume AI trains.

Always use absolute signals (not permissive). I've used semaphores in this example because it is then possible to see the indications from both sides.

In the crossing loops position the signals as shown - four squares apart. The signals in the single track section are important but not essential (experience has taught me that they do help) as are the signals at the entrance and exit of the single track section.

The signals mid block in the crossing loops help if you intend running freight or passenger trains at suicidally short headways, that is around about the frequency of suburban metro systems. The signals make it possible to store two AI trains per track in the loops.

The Track Markers are set up for North American right hand running. Position them as shown in the video. It makes it easier if they are named in sequences x(01) through to x(99) where x = alphanumeric. The brackets are important. In the example, the anticlockwise Track Markers are a(01) through a(04) and the clockwise Markers c(01) through c(04).

Video here - best watched full screen and in HD:


(CONTINUES)
 
Last edited:
(CONTINUED)

Tutorial Two - Configuring the Portals.

I've added two commands from the Download Station. "InstantLoad_12", kuid kuid2:45324:555017:4, and "DriveToTrackmarkList", kuid kuid2:61392:1050:3.

The first will load freight cars with a commodity taken at random from the freight car's config.txt file. The second makes it easier to allocate a path to an AI train, which is where the Track Marker x(01) notation becomes important.

In the video I've used "Central Portal Control" to configure the portals. CPC allows all the portals on the route to be configured from one screen and CPC will emit an AI train immediately the session commences.

One portal emits trains at two minute intervals. The other has been set to three minutes, plus or minus one minute. The latter gives more of a random crossing of trains in the loops. And, yes, it's freight trains at suburban metro frequencies.

Video here (again, best watched full screen and in HD):


(CONTINUES)
 
I mean no disrespect Phil, but I am afraid I just don't understand. The example is very small compared to the typical trainz route, and that alone does have an effect on the AI driving (and maybe the placement of so many unnecessary signals?). I think that perhaps a disclaimer is in order.

...and don't you mean 'passing loops'?
 
(CONTINUED)

Video Three - The End Result.

In the video we watch the AI trains circulating around the route. The video runs for about 15 minutes.

Trains run both clockwise and anticlockwise. When necessary they stop in a crossing loop to allow an oncoming AI train to clear a single track section.

Despite the high frequency of the trains (2 minutes from one portal, 3 minutes +/- 1 minute from the other portal) it all runs like clockwork.


Questions and comments are welcome.

Once I package them up I'll upload both the route and session to the Download Station.

Phil
 
Last edited:
Hi Justin --

"I mean no disrespect ... " and no disrespect is taken.

In fact, thanks for the comments. They are appreciated.

"The example is very small compared to the typical trainz route ... ."

Well, yes compared to your prototype routes. Compared to most of my routes it's just "small" (without the "very").

But it's applicable to both big and small routes. The limiting factor is the distance that AI "sees" ahead. I think you have done work on this - is it something like 20km for the next switch before it disappears from the system?

If I had made a mock up of a 60km route with one loop and AI trains at 30 minute headways the final video would have to be of, what, maybe 20 hours duration to capture one crossing. Possibly too boring to make never mind about watching. So think of it as a demonstration that is expandable in both scope and scale.

" ... so many unnecessary signals?"

Possibly. It will/may work with fewer; but (like the can opener) not guaranteed. I'll let others experiment.

"...and don't you mean 'passing loops'?"

Well, yes and no. Here in South Australia we talk of "passes" and "crosses" in loops. A pass is where one train overtakes another that is travelling in the same direction. A cross is where opposing trains meet.

Phil
 
But it's applicable to both big and small routes. The limiting factor is the distance that AI "sees" ahead. I think you have done work on this - is it something like 20km for the next switch before it disappears from the system?

32km between signals is maximum. Assuming you follow that max distance, the AI will not have any problem following signal indications.

By having so many signals that close together you are effectively limiting the block/track reservation the AI makes. I guess what I mean is, this setup probably works fine without all the extra signals, and because of them, probably wouldn't work on a larger scale. you would likely get meets head on between your so called crossing loops.
 
Hello Phil,
Thank you for your good work and for giving it to us freely. Sorry for this late reaction, I was busy following your instructions and trying it out on a route of my own.
It worked really fine. But I have a few questions. It did not work with some locs. Why? It did not work when I used some animated junctions which is a pity. The junction that should be protected was thrown anyway. A trick in the loc or something particular to animated junctions?
Cornelis
 
Hi Cornelis --

I've never had any issues with locomotives not working. No, let me qualify that. There was one particular Russian locomotive. I eventually discovered that brakes did not respond which meant that it would always over run red signals.

Animated junctions? I've never attempted to use them - they always seemed to fiddly to set up.

I've also done a bit more work on that little demonstration route. The result can be seen in my Post #1189 here:

http://forums.auran.com/trainz/showthread.php?109038-Model-Railroadz/page80

The layout is fitted with "Signal Link" that makes it easier for a player to take control of a single track section.

Phil
 
Great tutorial videos Phil, I tried it and it worked beautifully. I've been at this for a few years now and have always had signalling problems. It's probably not fully understanding, which signals are best for each circumstance. However I'm never too old to learn. Cheers from Redcliffe, Qld.
Roy3b3
 
I'm afraid I didn't watch much of the video (yet) but your methods seem to dovetail nicely with what I had to do in my largest route. Kudos on a good job all around. OTOH, what Dave Snow suggested in the 'Cornfield-meets' thread that lead me here was more typical of what I had to do in my very mountainous largest route.

Would you perhaps consider writing a series, or at least a couple of tutorials on signaling aimed specifically at newbies for the Wikibooks and Trainz Wiki. I've got the infrastructure on the Wikibook arranged now to allow cross-links to anywhere, licensing templates for ease of uploading images, and will be soon threading and finishing updating extant pages on general topics so it's going to be much easier to get around. Unlike most works, the scheme is to present a topic with links to related tutorials and reference material ahead of the Wikibook main body of prose, that is following as section two after the intro section. I see no reason to not cross link good efforts by the user community on similar mazterials and solutions we all face, and such sections will go far in inspiring newbies of a sense of the history and community we in Yesterdayz-Trainz hope to reinvigorate. For this reason and many others I mourn the retirement from Trainz by PhilC and others who have contributed so much over the years.

The search engine there on the Wikibook works much better than the Trainz Wiki for starters--N3V hasn't discovered CSS and Javascript common files alas. I did submit a formal request ticket and got smacked down! Using the tools I've put together to post an article (Call this a pre-announcement of a request for contributions) one will be able to put up a tech manual for anything, especially perfect for a route and it's sessions or a tutorial or highly scripted asset system (and supported by video or audio links!), and then (because linking is via templates) I've set it up so one can directly copy to the Trainz Wiki (after I finish complementary templates). [and assuming they support hosting videos eventually]

The longevity of the Wikimedia Foundation is, unlike the Trainz Wiki, quite stable and not the least uncertain. Give it some thought please, and thanks for being a conscientious contributor adding to the wealth of the community. Without guys like you and the content creators populating the DLS despite N3V peccadilloes, there wouldn't be a Trainz.(Their failure to just ignore former keywords and auto-update to containers when tags were superceded... just boggles the mind to me as a programmer. Can't think of a worse coding philosophy in a data base product! Probably a finals contender for "worse decisions ever made", world class competition.)
Best regards, Frank
 
Back
Top