A lot has been said about the reliability of AI in Trainz.......

and I have always had a lot of sucess with AI traffic in my favorite route: Rocky Mountains Montana Track.

The guy that created and/or updated this route may be a genious with setting up signals, I don't know because I have not tried to understand signals yet but what I do see in the route is many directinal track markers and I think they are probably most responsible for the AI behaving well.

It takes maybe 2-3 hours to travel end to end and I always setup passenger service going both ways, stopping at all stations inbetween and of course, the passenger trains have to negociate crossovers because the stations are always on one side of the right-of-way or the other and I have them emit immediately and then every 1 1/2 hours.

On top of that I have commodity trains that emit immediately and then every 2 hours and often those trains get hijacked to deliver and then move on to pick up more someware else. At some point when it gets too crowded, I'll send them into a portal.

After a while there is quite a bit of traffic and I must say that I have to deal with small problems once in a while but it's really not too bad.

Wild Willy the Wacko
 
Getting the AI to behave is something that takes a lot of time and patience. I noticed that when things work, they work very well and when they don't it can be pure hell.

The thing is, building a route is the easy part, getting the sessions to work successfully is where the bulk of the hard work goes into making the route a real success. Like any sort of programming, an in a sense this is programming, it takes planning, building, running, and debugging. The latter two steps are the longest and require the most effort. During the testing and debugging phases, the errors are found, removed, and the testing is repeated until everything works as planned. I have discovered various times that what I thought were program bugs were what I refer to as self-inflicted bugs. Sometimes, we think too far ahead and skip a step, or sometimes think what we want but don't tell the AI what we want them to do.

My Gloucester Terminal Electric, a switching and trolley line based around Gloucester Massachusetts is a success. The AI are setup to run a continuous circuit around the route from one end to the other with typical trolley stops along the way. In addition, I have a busy mainline with freight trains and commuter trains running between two portals. There are a couple of passenger stations on the mainline for the commuter trains to stop and the trolleys share a couple of these stations at two different ends of the route. In addition to the mainline operations, and intermixed among the trolleys, is a freight switching operation. This is where I come in. While the AI are busy running back and forth, I'm switching and setting up consists myself. I then make a run on the trolley line as I make trips across to the dockside branch and switch out various industries. Sometimes, I'll empty the yard and send the freight out on one of the passing freight trains on the mainline. This requires stopping the mainline train and switching in my cars I want to send along the way. It took a bit of time, like a few months actually, to get the AI to behave and finally I have succeeded with AI running for hours unattended while I do my thing. Just last night, I ran the route for about 6 hours before I finally caved and had to go to bed.
 
IMHO you're ALWAYS testing when you're playing with your route! What's that rule--? "If something CAN go wrong, it WILL go wrong." It's just a constant process of catching a place or AI that doesn't behave and fixing it every time you run a session in your route. Yes, you can create "sucessful" routes, but I still think (and it may take weeks) that something will invaribly go wrong.
 
Yes, you can create "sucessful" routes, but I still think (and it may take weeks) that something will invaribly go wrong.

But isn't that exactly like real life and real railroads? That's why we still have human dispatchers/controllers/signallers running the railways instead of AI algorithms (that plus the cost of AI).

Just saying :eek:
 
AI drivers never behaving how you want them to with often hilarious results has been a meme in Trainz since the early days - remember the old jokes about a certain AI driver whose name started with A? - but it has improved over the years considerably.

Often many of the issues are down to user-created errors (things as innocuous as using the wrong kind of trackmark in the wrong place, or the wrong kind of signal in the wrong location), something I am all too guilty of myself! :p

To say nothing of scripting being a bowl of spaghetti at the best of times, so inevitably things are bound to go chaotically wrong sooner or later the more complex it becomes.
 
Last edited:
You are very right.......

Getting the AI to behave is something that takes a lot of time and patience. I noticed that when things work, they work very well and when they don't it can be pure hell.

The thing is, building a route is the easy part, getting the sessions to work successfully is where the bulk of the hard work goes into making the route a real success. Like any sort of programming, an in a sense this is programming, it takes planning, building, running, and debugging. The latter two steps are the longest and require the most effort. During the testing and debugging phases, the errors are found, removed, and the testing is repeated until everything works as planned. I have discovered various times that what I thought were program bugs were what I refer to as self-inflicted bugs. Sometimes, we think too far ahead and skip a step, or sometimes think what we want but don't tell the AI what we want them to do.

My Gloucester Terminal Electric, a switching and trolley line based around Gloucester Massachusetts is a success. The AI are setup to run a continuous circuit around the route from one end to the other with typical trolley stops along the way. In addition, I have a busy mainline with freight trains and commuter trains running between two portals. There are a couple of passenger stations on the mainline for the commuter trains to stop and the trolleys share a couple of these stations at two different ends of the route. In addition to the mainline operations, and intermixed among the trolleys, is a freight switching operation. This is where I come in. While the AI are busy running back and forth, I'm switching and setting up consists myself. I then make a run on the trolley line as I make trips across to the dockside branch and switch out various industries. Sometimes, I'll empty the yard and send the freight out on one of the passing freight trains on the mainline. This requires stopping the mainline train and switching in my cars I want to send along the way. It took a bit of time, like a few months actually, to get the AI to behave and finally I have succeeded with AI running for hours unattended while I do my thing. Just last night, I ran the route for about 6 hours before I finally caved and had to go to bed.


when you say:

" I have discovered various times that what I thought were program bugs were what I refer to as self-inflicted bugs."

Yesterday in testing I found a mistake I made:

In my route there are these tripple divergent turnouts that have a very short straight ahead piece of track with a bumper end and I had gone through the route and thrown the switches toward the main line so that I would not accidently run my driver trains into the bumper and crash but upon testing I found that the AI trains were reluctant to enter from the opposite end of the yard apparently because they see the back of themselves as traffic already on the main. Now I want to go back and edit to throw the switches the opposite way than how I have them now.

I always thought that the author had this track configuration just as a means of keeping parallel tracks in the yard parallel, but it would seem that he knew AI would like the turnouts to be switched to the short end in the middle of the diverging side of the turnout!

Wild Willy the Wacko
 
when you say:

" I have discovered various times that what I thought were program bugs were what I refer to as self-inflicted bugs."

Yesterday in testing I found a mistake I made:

In my route there are these tripple divergent turnouts that have a very short straight ahead piece of track with a bumper end and I had gone through the route and thrown the switches toward the main line so that I would not accidently run my driver trains into the bumper and crash but upon testing I found that the AI trains were reluctant to enter from the opposite end of the yard apparently because they see the back of themselves as traffic already on the main. Now I want to go back and edit to throw the switches the opposite way than how I have them now.

I always thought that the author had this track configuration just as a means of keeping parallel tracks in the yard parallel, but it would seem that he knew AI would like the turnouts to be switched to the short end in the middle of the diverging side of the turnout!

Wild Willy the Wacko

This has always been an issue with the AI, and this is one of the solutions to the problem. Some yards do, however have a tail track like that at the throat. I think this is a safety measure to prevent a train from exiting the yard in error. For the AI drivers, this does work for loop solutions. My solution was to place a Type 05 (A permissive or advanced signal in JR signal terms) signal in the direction of travel for the AI. What this does is it lets the AI see itself as another train ahead but allows the AI to move along until the driver exits the loop.

Believe me, this took some figuring out and I found it a lot easier than remembering to flip a switch unless I had to.
 
That's kinda what I do in the set-up of my session.

My approach to it is just to keep it simple point a to point b.


My passenger service just goes end to end dropping & picking up passsengers.

My six different commodities trains go end to end and are just traffic to see and interact with unless I decide that, for instance, I can't keep up with coal deleveries to the power station. Then, I will divert a trainload of coal to it.

One of my ultimate goals is to set up the " Power Station Rule " and make the operation of the other industries dependent on the power station providing a constant output.

Wild Willy the Wacko
 
Back
Top