AI Operation ???

dricketts

Trainz Luvr since 2004
I just started adding some industry track and started using the AI to execute some very simple switching maneuvers on my WIP route in TS2010. I know 2010 was advertised as to having better AI logic. Am I one of a minority that doesn't see this at all?

At first I gave TS2010 the benefit of the doubt but after a couple of days it's the same old thing. The AI will take the most absurd, round about route to execute a simple couple command to a consist that is only a few feet away.

Looks to me like there is still room for improvement on future versions. I would like to hear any other experienced routes builders chime in on this topic.
 
Last edited:
'couple' is a bit dodgey, but 'Couple to vehicle facing trackmark' is near bombproof! Just make sure the trackmark is the right way around!

Andy
 
'couple' is a bit dodgey, but 'Couple to vehicle facing trackmark' is near bombproof! Just make sure the trackmark is the right way around!

Andy

Thanks for the tip. Maybe I just need to experiment with some new AI commands. Are most of these new commands built in or need to be downloaded the via the DLS?
 
Reference for AI

I just started adding some industry track and started using the AI to execute some very simple switching maneuvers on my WIP route in TS2010. I know 2010 was advertised as to having better AI logic. Am I one of a minority that doesn't see this at all?

At first I gave TS2010 the benefit of the doubt but after a couple of days it's the same old thing. The AI will take the most absurd, round about route to execute a simple couple command to a consist that is only a few feet away.

Looks to me like there is still room for improvement on future versions. I would like to hear any other experienced routes builders chime in on this topic.

Dricketts;
I too get fustrated with AI and see no improvement is TS 10 or 12.
I wish the programming staff at Auron would publish a white paper explaining the logic for AI Trains ( I have written to them with out response).

Minewhile here is a link to a set of tourials by crb001:
http://trains.0catch.com/index.html

Look at Part 14 and the case studies in the tutorial. I have found that a liberal use of the direction markers really helps. I place one in every station and industry where the trains are expected to go in one direction only. This seems to avoid trains going past a siding and then trying to back up. Also using a permisive 05 signal inside the entrance of a siding lets following trains enter the siding and follow a leading train instest of being blocked and skipping a stop.

Hope this helps,
Irving
 
I don't completely understand it yet, but from testing I have a few theories;

1. Navigate to or via - the AI train will try to find a "sprint", given a choice between a track with a 50mph section for three miles and one with a 100 foot 70mph section followed by 20mph for the remainder of the three miles, it will choose the slower track simply because it can go faster initially. Same thing with "up" and "down" tracks, with right handed running it will choose the left track since there are less or no signals facing that direction.

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

I haven't determined exactly why it chooses convoluted paths, but my theory is that it's short sighted and looks for whatever path will allow it to go fastest at the beginning even if it takes longer overall - it will even do silly things like backing up onto the wrong track, running 10 miles the wrong way past the marker, then reversing again to back the wrong way on the correct track to the marker from the wrong direction. :hehe:

Drive to or via trackmark seems to work better overall, near as I can tell it takes the shortest or most direct path when using the Drive command instead of Navigate. Drive is built in but off by default, you have to edit the session rules to activate it. Why, dunno.

PON_Dwarf_Signal_USA_L02_Permissive,<kuid:522774:100020>
PON_Dwarf_Signal_USA_02_Permissive,<kuid:522774:100021>

Those two were made specifically for the problem of AI trains reluctant to enter a yard to pick up a train, place one at each yard entrance with no other signals between the permissive dwarf and the yard track, it will get a red over red signal but proceed anyway since it is permissive.

Sequence I use;
1. Drive to trackmark 1.
2. Wait 5 (or 20 or 30) seconds (needed so it comes to a full stop and don't collide with uncoupled cars)
3. Uncouplez From (car number)
4. Wait 5 (or 20 or 30) seconds
5. Drive to (whatever next destination)

For the pickup, merely drive to trackmark, couple at trackmark works fine as long as there's a car or cars near the trackmark and there are no absolute signals that would make it do something stupid like waiting for the cars it's supposed to couple onto to clear the block so it can get a green to enter the block to couple onto the cars which wouldn't be there if they cleared the block somehow. :confused: Near as I can tell permissive signals are a must, without one at some point it will get a red signal and refuse to go further.
 
Lots of posts about Drivers Commands and AI drivers. This question could take a month of sundays to answer:) .I can point you in the right (generally) direction). You instruct the AI to drive from A to B. The AI will draw a straight line between A and B and select the "quickest" route in terms of distance. The fact that it has to drive through a lumber mill is neither here or there, lol. In order to make it take the route you want it to take involves placing red track markers and yellow direction markers. Two examples. you have a double track line for trains in each direction and there is a crossover connecting them. place a yellow track marker on the two tracks with the tip pointing in the direction of travel. this will stop trains going the "wrong way" You have a main line with a loop where trains wait for another train to pass. Yellow track markers are no good here. Place two red track markers, one in the loop adjacent to or just past the signal that takes you back to the main line as you would want the train to stop here. The other on the main line past the point switch that takes you into the loop. Give them a name you can remember such as Ranskill Loop or Ranskill Main line. You can now instuct an AI driver to "drive to (trackmark) Ranskill loop" and the train will stop in the loop near the exit signal. Or you can instuct the AI driver to "drive via (trackmark) Ranskill Main Line" These two examples are intended to explain the basic principles of AI train control. There are other methods such as path control and priority markers. One other thing. An AI driver does not stop at a trackmark but a short distance before, about 1-2 locomotive lengths so you may need to move your track marker slightly. If you have a specific question about AI control you can post it here. the "couple at trackmark" command works well by the way. There are also tutorials on the subject.
 
Last edited:
Thanks for everyone's input but I give up...

I thought I had signals, junctions, and the AI figured out a couple of years ago but not. :confused:

I completely redid a section of my route replacing track, signals, and junctions to eliminate any errors and I still can not figure out for the life of me the ridiculous decisions the AI is making on a simple passing siding. I've seen this behavior on other parts of the route in very simple track configurations. I swear it seems the AI worked better in TS2004.
 
Last edited:
The only problem ive had on this is the engine will go to a junction before it will return. If it approaches the top of a Y junction it keeps going, but if it approaches from the bottom it stops straight away and returns. So i now drive to a TM before a couple command.
 
Jim -- DriveToTrackmarkList

Jim --

If you haven't seen it, this post can make it incredibly easy to path AI Trainz:

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

It's based on giving the trackmarkers the correct designation, in the form of, for example, a(1), a(2), a(3), ... . The common prefix followed by the brackets are the critical parts.

The rule can then be used so that the AI follows the trackmarkers in sequence. It can also be configured so that it follows all the "a"s, then "b"s, ... .

It sure as hell beats inserting each individual trackmarker into the AI path. I've found that it works in Central Portal Control.

Might be useful for your complex routes. Wish I'd know about this when I was doing PO&N.

Phil
 
What about a red signal on a completely open and clear path to a car? I just get sooo tired of spending hours trying to get the AI work. It makes me want to chuck the whole game sometimes...

Edit: Interesting. After 4 minutes or so of the AI trying to advance past this red signal, the dreaded explanation mark over the driver character, junction lined correctly, it finally made the couple. I never remember seeing this kind of delay in TS2004? In 2004 it simply passed through the red signal at restricted speed right away. Why does TS2010 behave like this? I'm actually surprised it ever made the correct move.
 
Last edited:
I would say that everyone above is correct on how to handle the AI thing to couple. here goes my grain of salt: After much banging against the wall, I re-did the direction of track directions at every station and when possible at main lines too. If you look closely at track splines, you will see a small distorsion of the aligment of rails and or tie spacing; Furthermore, put a red trackmark over the track and "move" it along the track. You may see that it changes direction after passing a spline point! Some people say it is not important, but somehow AI does not like this. Try to have all your track running in the same direction. On another front, related to coupling: The loco finally goes to the track where the cars to be coupled are. It slows down at a realistic speed and stops for a moment.. and then proceeds at speed until it 'collides" with the car violently. In real world it will destroy all the kitchen wares of your restaurant car... Any comments?
 
Phil - "Absolutely no documentation though"

Got the drive instead of navigate figured out, got the schedule library figured out, got the trains running where they're supposed to without running into each other or the player, and now you want me to start figuring out some newfangled undocumented gadget? :hehe: Unless it's intuitively obvious to the clueless n00b, all this stuff should come with instructions, most of it don't.

Dricketts, again;

PON_Dwarf_Signal_USA_L02_Permissive,<kuid:522774:1 00020>
PON_Dwarf_Signal_USA_02_Permissive,<kuid:522774:10 0021>

There's a matching set of absolute signals if you need them for some reason, but as long as one of those is the last signal between the AI train and the cut of cars it's supposed to couple onto, it will always work. I never figured out how to even begin scripting AI traffic in 2004, but my guess is that all the signals in 2004 were permissive - in TS2010 most are absolute signals, meaning an AI train will stop at a red and not go thru it. That's why there are permissive signals, for when you want the AI to proceed at restricted speed on a red.

In MSTS there are actually 3 types;
1. Restricting - red means slow to restricted speed but keep going, not actually a stop order.
2. Stop and proceed - what it sounds like, red means come to a full stop, then proceed at restricted speed.
3. Absolute - stop means stop, do not go until the signal changes to something other than red.

Last one sounds like what you're having trouble with, both MSTS and Trainz an absolute signal indicating red will always stop an AI train dead.
 
Difficult to give you a definative answer but it does sound as though the AI was having trouble working out the path through the junction. This tends to occur when there are several point switches involved, a common problem. Place an invisable signal after the first 2 or 3 point switches which makes it easier for the poor old AI. The other point is the signal does need to be permissive to allow an AI train into an occupied section.
 
I would say that everyone above is correct on how to handle the AI thing to couple. here goes my grain of salt: After much banging against the wall, I re-did the direction of track directions at every station and when possible at main lines too. If you look closely at track splines, you will see a small distorsion of the aligment of rails and or tie spacing; Furthermore, put a red trackmark over the track and "move" it along the track. You may see that it changes direction after passing a spline point! Some people say it is not important, but somehow AI does not like this. Try to have all your track running in the same direction. On another front, related to coupling: The loco finally goes to the track where the cars to be coupled are. It slows down at a realistic speed and stops for a moment.. and then proceeds at speed until it 'collides" with the car violently. In real world it will destroy all the kitchen wares of your restaurant car... Any comments?
I have experienced the same thing as Llebrez when using the command "couple at trackmark" I tried moving the trackmark to different positions but it didn,t make any difference. I think the AI reacts to the position of the vehicle it is coupling up to and not the trackmark. I am having problems with the red trackmarks in ECML 2012. I have modified the route and either renamed existing trackmarks, deleted them or added new ones. The AI commonly fails to recognise them and I get the message "unable to navigate to trackmark". So I replace the trackmark and EUREKA! the AI finds it as easily as a bloodhound following a strong scent. I have no idea why.
 
In MSTS there are actually 3 types;
1. Restricting - red means slow to restricted speed but keep going, not actually a stop order.
2. Stop and proceed - what it sounds like, red means come to a full stop, then proceed at restricted speed.
3. Absolute - stop means stop, do not go until the signal changes to something other than red.

My understanding directly from Norfolk37 who made the JR signals is all signals behave and works the same. Regardless if it's restricting, stop, absolute, etc. The only difference is purely aesthetics. The scripting in Trainz controls how all signals interact with the AI. As to my experience this is true. Also I'm modeling a route that had no signals so I'm using invisible signals to avoid cornfield meets.

Like someone mentioned earlier if we had the white papers or logic behind the scripting with regard to signals and the AI we could all probably make better sense of the AI behavior.
 
I put a track mark after every switch that is between where the locomotive is and where the car to be couple to resides. This helps AI to make the routeing decisions quickly.

I then use the CoupleToVehicleNearSignal,<kuid:131986:1004> Make sure there is a signal either facing the locomotive or facing the cars - you have a choice in the command.

Works every time for me.

David
 
"... all signals behave and works the same. Regardless if it's restricting, stop, absolute, etc. The only difference is purely aesthetics..."

Dunno if that was true for TS2009 and earlier, but it's wrong for TS2010. If you give an AI a command to couple at trackmark, and the last signal between him and that trackmark is an absolute, he will stop at the signal and randomly throw combinations of switches trying to find an unblocked path to the marker. Eventually he creeps forward enough to trigger "signal passed at danger, emergency braking completed, resuming schedule in 2 minutes" and will execute the coupling after that. If the last signal before the trackmark is a permissive, he will proceed through that signal without stopping.
 
"... all signals behave and works the same. Regardless if it's restricting, stop, absolute, etc. The only difference is purely aesthetics..."

Dunno if that was true for TS2009 and earlier, but it's wrong for TS2010. If you give an AI a command to couple at trackmark, and the last signal between him and that trackmark is an absolute, he will stop at the signal and randomly throw combinations of switches trying to find an unblocked path to the marker. Eventually he creeps forward enough to trigger "signal passed at danger, emergency braking completed, resuming schedule in 2 minutes" and will execute the coupling after that. If the last signal before the trackmark is a permissive, he will proceed through that signal without stopping.

What you're saying makes sense and I've witnessed that exact behavior at times. I'm just going of what one signal creator explained to me. I'd love for Norfolk37 to clarify this. If a permissive actually changes the behavior of the AI what is keeping the AI to pass the signal and meet another AI train head on?

Does anyone know of a invisible permissive signal?
 
Last edited:
Can't find one, but it's easy enough to make one, just use a sign mesh and add the surveyor-only 1 tag. Look for;

Permissive double head invisible signal,<kuid:522774:100639>

Sometime over the next day or two (or seventeen depending on whether the upload 'bot jams up again).

As for Justin, like I said it's entirely possible that it used to be that way and was changed in TS2010. What's to keep an AI from colliding with another AI, don't use permissive signals on the mainline.
 
Definitions of Drive (to, via) and Navigate (to, via)

Great thread, 19 replies in 12 hours!
Anyway, read my post:

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

for descriptions of the Drive and Naviagate commands, which I copied from the corrosponding TRS 2009 config files. The descriptions were changed in TRS 2009, which may explain changes in in behavoir from earlier editions. Note the new Navigate commands were actually the earlier Drive Commands (same kuid's) and new Drive commands were added with new kuid's.

In short; Drive implies taking the shortest path regardless of blocking trains, and Navigate implies taking a non-blocked path and routing around blocking trains. We have all seen that the routing around may necesiate backing up to run around the blockage and other strange actions.

Unfortunately the descriptions use the phrase, 'allows a driver to take', which means to me that the Drive to, using the shortest path is not mandatory, so we see AI drivers pause at a blockage for a few moments and the seak an alternate path.

Comments are invited, Irving
 
Back
Top