AI and Switches

nicky9499

SSoTW Bot
Good day chaps,

I have a situation that goes like this. Player train under AI (let's call him Stupid) control is set to drive from A to B, all switches have already been set and locked, same for signals. There are other AI trains on the route as well, their paths have also been set as well. Now all Stupid has to do is drive.

So he comes up to a red at a complex junction where he'll meet another train, prearranged obviously. Now all I need Stupid to do is just quietly sit there and don't be an idiot. I mean how hard can it be right? I didn't even tell him to "Navigate To" anywhere. But noooo. His stupid butt starts itching so he throws a couple switches, trying to weasel his way around the red, in the process messing up the path of another AI train and derailing it.

Now I am aware of the "autodrive" and "STW drive" commands, both of which do the "just drive, idiot" thing very well. Problem with the former is "autodrive to ___" doesn't work and the latter doesn't even have such a command either, so the user has to disable the command manually which is not what I want in a completely hands-off intro ride.

Can someone advise please?

Regards,
Nicholas
 
In another instance, Stupid comes to a switch where two lines merge into one. All he has to do is sit and wait at the red. I even put in a WaitFor>2min command. But of course things go sideways, this is goddamn Trainz what were you expecting. It gets there, WaitFor>2min very much active mind you, but decides to play with the bloody switch anyway so now the incoming train has to stop and play a moronic tug-of-war game with Stupid. After each "tug" the incoming train inches closer to the protecting 06 signal, so after some time the incoming train eventually passes signal and goes ahead nose-to-nose with Stupid.

This isn't a freeform, let-them-loose kind of session. I've locked it down as tight as a supermax in Guantanamo, I am literally spoonfeeding directions to the AI. Every junction along everyone's route is pre-set, fixed and locked and timed with triggers. Why. Is. This. Happening.

N3V shouldn't call these AI. AS is more befitting. Artificial Stupidity.
 
G'day Nicholas, I'm sure there was a rule "stop until not red" or something like that, I could be wrong but it was something like that.
Regards
Barrie

Edit:- Had a quick look and found these which (theoretically) should do the trick.
AI Wait until not red signal <kuid2:151055:100102:3>
Waits for the next signal to show permissive aspect (max. 3000 metres)


AI Wait until green signal <kuid2:151055:100101:3>
Waits for the next signal to show green aspect (max. 3000 metres)


Wait Until Not Red <kuid2:192081:7:1>
By brummfondel

As always with trainz there are no guarantees.
Regards
Barrie
 
Last edited:
Autodrive works with the set path rule if I remember right. With the set path rule other trains cant change the points until the train setting them has passed the last trigger in the set up rule. I used it on one of my routes some time ago and all trains would wait until its path rule was set.
 
Hi Nicholas

As stagecoach says the Autodrive driver command is used in conjunction with the path setting commands - specifically with the "jsTRF-Path Control" and "jsTRF-Path Trigger" rules and the "PathControl setpath" driver command, all by username "brummfondel" and on the DLS. It can also be used with the "Path Library" rule and "Path Command" driver command by "_mutton_" which are built in to TS12.

I have used these rules and driver commands extensively and find that they eliminate the random decisions made by the AI. The drawback to them is that it takes time to set all the paths up before you can use them. The brummfondel paths also require all signals to be named along the path but is a little quicker in use.

I currently use the SCS2013 rule for programming all my sessions as this uses the path setting principle but also contains a number of conditional commands such as If, If Else and If End and also Select, Select Case and Select End amongst a number of others. These allow the trains to make decisions for themselves when combined with variables. As an example, a fast train using a stretch of track will set a variable to Yes. A freight train up ahead will periodically check the variable and if it is set to Yes it will turn itself into the next passing loop and wait for the fast train to pass before continuing on its way.

Information on the SCS2013 rule and editor is available in this thread http://forums.auran.com/trainz/show...ike-to-try-SCS2013-for-TS12&highlight=scs2013.

All the above take the decision making away from the AI which means that sessions run the way that I want them to - if they don't it is because of a mistake that I have made with the logic of what should be happening.

I started using these rules because of the frustration of the AI doing what it wants. It takes a bit more work but I find it more satisfying and less stressful in the long run.

Regards

Brian
 
Hi Nick,

The alternative might be the simple Drive To... rule. According to James Moody, if I've got this straight, the Drive To... will keep the AI from hunting around for alternative routes and is good for point-A to point-B situations. This won't work in a yard situation, where the Navigate To is better, but on main line situations it works well.

John
 
I have had great success with the Multi-Path-Control rule plus the Route-Control driver command and autodrive. I find that with autodrive the AI does not change switch positions and obeys signals.
 
Hey guys,

Thank you all for the come back, I really appreciate it and I'm sure the more elaborate implementations will come in useful someday as the route and sessions increase in complexity.

Wait Until Not Red <kuid2:192081:7:1>
By brummfondel

In this case, this simple solution worked beautifully. All I had to do was add a trackmark (eg. "user ai red stop 01") and a Wait Until Not Red immediately after that. AI behaves very nicely now.

Unfortunately John, it seems James is wrong because I have used nothing but Drive To and Drive Via commands in this session knowing full well what "Navigate" means as other users have said in the past, still they try to get smart whenever stopped at a red.

Cheerio,
Nicholas
 
Hey guys,

Thank you all for the come back, I really appreciate it and I'm sure the more elaborate implementations will come in useful someday as the route and sessions increase in complexity.



In this case, this simple solution worked beautifully. All I had to do was add a trackmark (eg. "user ai red stop 01") and a Wait Until Not Red immediately after that. AI behaves very nicely now.

Unfortunately John, it seems James is wrong because I have used nothing but Drive To and Drive Via commands in this session knowing full well what "Navigate" means as other users have said in the past, still they try to get smart whenever stopped at a red.

Cheerio,
Nicholas

Your even easier approach worked which is great.

As I've found out too with both, but sometimes the Drive To does work as prescribed. I suppose you have to give things a try first.

John
 
Back
Top