AI Traffic

flyguy747

New member
Hi folks, I just bought Trainz 12 and have been trying to create my own routes. I wish to add AI traffic into my routes yet have no idea where to start. If someone could please suggest where I can learn what exactly AI traffic is and how to create it, I would be very thankful.
 
Hi flyguy747,

Welcome to the world of Trainz, when you get into this sim it will take up lots of your spare time.

To start of load a map of your choice, you will then be in Surveyor where you can place trainz on the map and give your driver some orders.
First click on the rollingstock tab (the one that looks like a wheel on the right of the screen), scroll down and select a locomotive, click on the loco, click on the plus icon + then click on the track. The loco selected should now appear on the track and have a driver allocated. From here you can do a few different things, i.e. give the driver orders to drive to somewhere etc. or you can go into quick drive and drive the loco yourself. If you want to give the driver orders to go somewhere it will pay to have a sheet of paper and pen handy. Follow the track in surveyor and note down any track marks, industries or stations you want the driver to go via or go to. Once you know where you want to go click on main menu, edit session then driver setup. Your driver will appear at the bottom of the screen with a small green arrow icon just to the right of the driver's picture. Click on the small arrow icon and a list of commands will popup, click on a command and it will appear in the driver command bar at the bottom of the screen. When your list of commands is complete click on quick drive and the driver will carry out your commands.

Hope this helps,
Bill69
 
This here;

http://trains.0catch.com/tutorial.html

Might look like the wrong place at first, but it all ties together - tracklaying, signals, track markers, all affect how AI traffic works. I'm currently going thru my route removing a lot of double crossovers (because none of the signals display the correct aspects with a double crossover) and also getting rid of a lot of right-to-left single crossovers, leaving only the left-to-right. That makes the player have to do a double backing movement to get onto the left track, but it keeps AI trains from taking the scenic route - "Oh look! A crossover, let's EXPLORE!" :hehe: The AI traffic in TS2010 is MUCH more intelligent and versatile than the other two of the "Big Three" trainsims, but it's also more psychotic.
 
From what I have experimented with AI in TRS2006 is that if signals are spaced too far apart, and a train in front of the rest is going so slow that it takes an extremely long time to clear the signal, that the AI Drive Schedual for the trailing following train "times out", and needs a new click on "Drive", "DriveTo" or "Drive Via".

AI Trainz sometimes (always take their own shortest path, oftentimes in reverse) and throw turnouts ... to stop this, track directional markers, or train priority markers need to be configured, and need to be placed, to block the errant path of "A Brainless Mind Of Their Own" AI Trainz.

If you want a train to go from point A to point D ... you have make a progressive schedual, to tell it to go via point B, and then via point C, and then to D.
 
Last edited:
This here;

http://trains.0catch.com/tutorial.html

Might look like the wrong place at first, but it all ties together - tracklaying, signals, track markers, all affect how AI traffic works. I'm currently going thru my route removing a lot of double crossovers (because none of the signals display the correct aspects with a double crossover) and also getting rid of a lot of right-to-left single crossovers, leaving only the left-to-right. That makes the player have to do a double backing movement to get onto the left track, but it keeps AI trains from taking the scenic route - "Oh look! A crossover, let's EXPLORE!" :hehe: The AI traffic in TS2010 is MUCH more intelligent and versatile than the other two of the "Big Three" trainsims, but it's also more psychotic.

I did the same thing recently because of the "exploration" issue. It still baffles me why they do that and end up getting everything into a snit, and my knickers into a twist particularly when the main line is 65 mph and the yard is 20mph.

I've used track marks and direction track marks to help keep them on course, which work pretty well.

John
 
Here's the one that really fried my bacon;



Uploaded with ImageShack.us

Passed the last Navigate Via trackmark, 200 yards straight ahead to the destination portal, even Railworks AI traffic shouldn't be able to get lost under those conditions. Give the little culprit ONE facing point switch that leads to another planet in a different universe in an alternate dimension and it will sometimes decide to take it anyway. :confused:
 
Thanks a lot to all the folks that replied....hopefully with careful examination of all the material and lots of trial and error ill get the hang of this. Glad to see such an active community of trainz fans. Thanks a bunch!
 
You know how when an AI Train stops for a stopped train ahead, and the following AI train "Times Out" and requires you hit "Drive" again.

Is there any way to stop AI Trainz from "Timing Out" ?

I want AI Trainz to drive automaticly, and continue the schedual, no matter how long they sit at a stop signal waiting for the train ahead to start.

What are some good AI Train session rules that you can add ?
 
There is one, "Wait until not Red" by brummfondel. What this rule does is that it tells the driver to wait until the signal turns green. <kuid2:192081:7:1>
 
How about a trackmark between the last switch and the portal. A via command should get the ai to the correct portal.


Rob
 
OK ... I dun' cyphered it out ... I'm gonna change my name to Jethro Bodine and become a brain surgeon ... cause I feel like I'm a Brainiac right now.

Who woulda' thunk:

Auto Pilot-Activate
Auto Drive-Drive Via Trackmark

Now I can set up 100 assembled trains on my route, and let them loose, and they will parade around my 50 mile route, endlessly ... now I can just sit back and railfan my route.

I connected Johnstown to Altoona by a 45 mile long, fictacious, hidden return track (my route is and endless dogbone shape now). Not being a fan of Portals, this hidden return track will recycle EB loaded coal trains, and WB empty coal trains nonstop, running trains automaticly, as they stop and restart at my trackside signals which are spaced every 1000' apart.

The old AI Trainz 15 second "Drive"-"time out" has been conqured !
 
Last edited:
"How about a trackmark between the last switch and the portal", yeah, that's the ridiculous part is it shouldn't NEED one after every single facing point switch. It's almost like there's a "diverge at every opportunity" programmed in. In that case it was following another AI train closely, the first AI slowed down when entering the portal, and the second idiot decided to try to go around him instead of waiting for the signal to clear. If there was any way to actually GET around him I could see the joke, but in that location there is no alternate path to that portal, why he thought he could get there by going to the other portal baffles logic. Adding another signal before the portal or taking the switch out or adding another trackmark works, the worst trouble is the AI is like women, if you don't severely limit their choices they'll be choosing all day.

Cascade, I was told once that "drive to" and "drive via" were old timey stuff, and I should use "navigate to" and "navigate via" instead. Dunno if it actually makes a difference, but if you're having problems it might be worth a try.
 
There is one, "Wait until not Red" by brummfondel. What this rule does is that it tells the driver to wait until the signal turns green. <kuid2:192081:7:1>
Don't quite understand....so without this rule the driver just goes through the red signal?? I don't think so, could you please explain the purpose of this command!
Thanks,
Mick Berg. :confused:
 
..................Cascade, I was told once that "drive to" and "drive via" were old timey stuff, and I should use "navigate to" and "navigate via" instead. Dunno if it actually makes a difference, but if you're having problems it might be worth a try.
I don't use the "navigate" commands at all. It seems they are the ones that allow the AI to go off "exploring", ie finding a way to get from A to B no matter how crazy it may be. I stick with the "drive" commands.
It may result in needing a few more trackmarks, but that's a small price to pay to get your train where you want it to go.
Just my 2 cents,
Mick Berg.
 
Don't quite understand....so without this rule the driver just goes through the red signal?? I don't think so, could you please explain the purpose of this command!
Thanks,
Mick Berg. :confused:

Hi Mick,

No the train probably won't go through a red. The purpose of the 'wait until not red' command is to stop the AI from timing out as above.
With this command he is still under orders and will carry on when the signal changes to caution. The command is not always required.

Cheers,
Bill69
 
I have been looking for the reason, or the code line, that causes "Drive" to time out after a train sits at a red signal for 15 seconds ... can this "Drive" "Time Out" setting be increased past 15 seconds ? Possibly set it to 3 minutes, or more ?

I noticed in Settings: the "timerate 0" and "startime 0.4" ?

I have tried all the commands and scripts that I can find, but I want "All" trains to "Just Drive" and throw their own signals.

I have tried the: "Just Drive" script ... but it still doesn't throw switchs, and seems to "Time Out", or stall, requiring "abandon schedual", or again manually hitting "Drive".

I want trains to drive automaticly, without setting paths for each and every train.

I have tried Autopilot and Autodrive, but they seem to have problems throwing switches, and following the path I have set.
 
Last edited:
" throw their own signals." you mean throw their own switches? I'm using Navigate Via and Navigate To instead of the Drive commands, I forget why (alzheimers). I don't have "time out" as far as I know, altho I think I could use something like "wait for track clearance" to stop them from trying to pull out and pass the next train ahead. Or maybe I'm already using it, I forget (alzheimers again, at least I THINK it's alzheimers, I'm so senile I can't remember if I have alzheimers or not), I did have a problem where they would slide across to another track whenever a crossover was available, I think I traced that down to seeing a choice between a route with a yellow ahead and another route with a green further away. Or something.

This one;

http://www.youtube.com/watch?v=xJb_8UywoRA

I had to place two intermediate track markers to specify a Navigate Via for the most logical route - but without them, the AI DID throw its own switches, in a seemingly random pattern, until it hit a combination that eventually led to the next Navigate Via marker.

Some theories;

1. Markers after any facing point switch with an alternate path to keep the little culprits on the track you want them to take. Track Direction Markers usually work, but I HAVE seen the AI ignore them until it causes a traffic jam. Probably need to be added immediately after the junction so they won't even try to go in there.
2. Signals, signals, and more signals. AI traffic in MSTS was a pain when everything went right, when it went wrong the problem was usually not enough signals. Got 17 facing point and 11 trailing point switches between the AI train and the next signal, he's gonna stop at a red and spend a long long time figuring out how to set a path to the next signal. Not always necessary to have a signal before every switch, but it helps.

You might try this;

http://forums.auran.com/trainz/showthread.php?t=74640

And reverse engineer some of the things I did - altho be warned I still don't have a complete handle on this yet.
 
Back
Top