Speed control for AI trains?

sniper297

Coconut God
Anyone done a study on what AI trains do when and why when it comes to speed limits?

78660049.jpg


I did some testing with these cars, at 60mph it takes less than 1/8 of a mile to come to a full stop, which is prototypical for the type. So if the limit is 50/60/70 on a given section and there's a 15/20/30 reduced speed at the end of the section, why do they slow to 1mph over the next speed limit several miles before reaching it? More importantly, how do I stop them from doing that? Preferably without adding yet another rule or script, do they go by switches, signals, or value of the next speed limit? If, for example, I add an invisible 70mph limit a few hundred feet before the 15mph speed limit sign, they still slow down miles before reaching it, do I need to add more invisible speed limit signs or more signals?
 
It's not the impending sped limit change, it's sigs and levers. The Trainz AI sees signals and levers as pretty much the same thing. Usually the 'needless' slow-down where everything appears to be clear is the AI working out what should be happening with the levers ahead. If the default switch position is for the needed route there is no slow-down, if the AI needs to throw switches it will slow or even stop.

Conventional wisdom holds that the AI looks two levers ahead but that may have changed with newer versions and/or scripted sigs might handle the situation better. Intermediate signals sometimes help, but as often they lead to a complete standstill because the AI won't look beyond a red sig till it arrives, it generally won't set the levers beyond a red signal as it approaches...

Andy
 
The '2 lever' rule appears to hold sway when it is facing a red light (ts2010).
A multitude of switches / levers when green appears.
I am using the trackview rule watching twelve consists under AI control closely packed on one board.
Only downloaded the rule recently, it's a must-have.
Rog
 
No problem getting the rule... but when I commit
in TS12, the result is a broken asset.

Error: The Tag 'trackview-defaults' is not permitted within a container of type 'behavior'.

Whats the method of entry in the config to make the rule usable?

AL
 
No problem getting the rule... but when I commit
in TS12, the result is a broken asset.

Error: The Tag 'trackview-defaults' is not permitted within a container of type 'behavior'.

Whats the method of entry in the config to make the rule usable?

AL

Can be fixed, there is a link/thread somewhere, did it myself not long ago, (age related);)
Will search it out.

Edit:

"I have managed to clear this error by moving the trackview-defaults into the extensions container."
A quote from Shane in an earlier posting, I hope he doesn't mind.
Rog
 
Last edited:
I recently fixed this rule. Shane posted the section of script that needs fixing so I copied and pasted it in the config text file and it works a dream.
Can't remember where the thread was though, it's here somewhere so just do a search. :wave:
 
I've had this rule for ages and love it, but it does have a problem, unless there's been a change I don't know about.

If the loco is facing backwards it will look at the track behind the consist instead of ahead.

I contacted the author, but he is no longer involved with Trainz and will not release the script or whatever to be fixed by anyone else. Pity.

Mick Berg.
 
Horray... Thanks Shane for the heads up.

That bit of info solved the error problem.

At first look it appears pretty versatile. The first
bit of a difficulty appears to be a positioning project
to avoid overlaying the existing HUD, but thats surmountable
from the looks of the config file.

Ah yes... yet another configurable asset. Don't ya just love it!

AL
 
It's OK - not sure if it's on the DLS Cleanup list, but I will look into it if it is and is not already claimed.

Shane

EDIT: It appears it's not on the DLS Cleanup list.
 
Hi Sniper,

Now this is just a guess, what I think may be happening?

I had a similar problem on a layout of mine, where the track followed a big loop. On part of the loop the AI drivers slowed right down. I think in Trainz each junction has a circular zone around it that allows the AI to detect the Junction. What I think was happening on my layout was part the loop intersected the detection zone of a points lever that was many miles away by track but close by as the crow flys. Because there were a large number of signals between the train and the Junction the AI could not detect the signal protecting the Junction so they slowed to a crawl until they were clear of the detection zone. Moving the Junction further away from the loop did improve the speed of the AI trains. By your screenshot your layout is a Metro type line. Is it possible your track doubles back a city block over?

Lindsay
 
I kinda doubt it but I'll look into it. I do have more problems on one line than the others, mainly because that line zigzags a lot with 50-60mph straights for 2 or 3 miles then 20-30mph curves, then back to 50-60 again. The real thing accelerates and decelerates with enough G forces to make an astronaut sick, most CTA riders are more interested in speed than comfort.
 
Almost forgot, for the other guys thanks for the suggestion, but anything I use has to be on the DLS and work out of the box with no errors. TS12 multiplayer compatibility is the end goal for everything I upload, meaning all accessories included no assembly required for the end user.
 
If you are referring to the Trackview rule, it was previously seen on the DLS Cleanup list, so I am assuming a fixed version was uploaded. If not, someone may need to check with the creator of said rule to see if he has a version of it that he can put on the Download Station.

Shane

EDIT: I cannot see it in the DLS search results under that name, so I guess it's up to the creator.
 
Well, after considerable testing my scientific conclusion is; I'm stumped. :hehe: It appears that the AI looks about a mile ahead at least when deciding how fast to go. In a test route I set up 60mph, then 40mph, then 70, then 30. Placed a series of poles 100 yards apart with track markers a mile apart, and proceeded to move the 70mph marker back and forth. If the 70mph marker is a mile short of the 30mph, it will accelerate from 40 to 70 (or a little less, this is also dependent on the numbers in the engine spec) and maintain 65-70 until 300-400 yards short of the 30mph limit sign then decelerate to 30. If the 70 sign is 4000 feet short of the 30 it will maintain 40mph (the previous limit) instead of accelerating. If the 70 sign is 3000 feet short of the 30, it will immediately slow from 40mph to 31mph as soon as it passes from the 40 zone to the 70 zone.

Conclusion: I dunno. I suspect trying to do an accurate depiction of the old Garfield Park L with the short sprints followed by heavy braking into the curves is impossible, I should probably set the entire 5 mile section to 40mph if it will take the curves at that speed. A marker just before each curve (or in the curve) with a drive to instead of drive via might create the best effect for AI trains, with fake speed limit signs for the player so he knows when to stomp on the binders for tight curves.
 
Is all the speed change also influenced by the actual weight of the train and the brake settings in the units?
 
Yeah, I cloned and tinkered then ran successive tests using one with the max deceleration number double or tripled. Found that with the same speed limit spacing one engine spec stayed at 40mph for the entire 3/4 mile of the 70mph section, the other accelerated to 53mph, then stopped accelerating and ran at that speed until 300 yards before the 30mph at which point it started decelerating. The train itself is capable of much heavier braking and much faster acceleration even in CAB mode, it appears that the AI engineers are just really conservative about train handling. The prototype is an oddball anyway, most passenger trains you ride don't start and stop every couple of blocks and they generally speed up or slow down smoothly, urban rapid transit is the only type I've been on that normally starts with a jerk and stops with a bang. Station stops were usually less than a minute from 60mph full speed to dead stop doors open doors shut (average 14 seconds of doors open) then back to full speed again. Riding the L in Chicago is actually more fun than a roller coaster, you learn at an early age to grab something and hang on tight the second you step aboard. :hehe:
 
Well, here's what I came up with;

47692929.jpg


Trackside scenery object so it's not actually a signal or a speed limit, but it has a flashing red light visible from a reasonable distance so the player knows when a tight curve is coming up. Doesn't affect AI train speed since they don't "see" it, essentially it's a fake reduced speed sign. Got a more reasonable time for the traffic pattern now, the AI trains spawn from one portal and run the entire pattern in about 1 1/2 hours before disappearing into the destination portal. Probably gonna increase that by having them loop the Loop twice in each direction, current pattern doesn't have anything close to enough traffic in the Loop.
 
Back
Top