Train pathfinding

Discuss maps, trains and other modding topics
Post Reply
Suspect
Posts: 5
Joined: Sun Apr 25, 2010 11:45 am

Train pathfinding

Post by Suspect » Sun Apr 25, 2010 11:51 am

Hi. I wonder if you can help me. Does anyone know of a way to improve the pathfinding of trains using multiple trains, tracks and switches. They seem to be pretty dumb. e.g. only using two tracks when there are 3 available.

It seems to be that their No.1 instruction is to find the quickest/shortest route, and using a track that another train is not on is instruction No.99!

Is it possible some script could be changed to correct this? or improve pathfinding? Any advice is appreciated.

User avatar
Jancsika
Posts: 921
Joined: Thu Nov 02, 2006 3:40 pm
Location: Maryland

Re: Train pathfinding

Post by Jancsika » Sun Apr 25, 2010 2:02 pm


Suspect
Posts: 5
Joined: Sun Apr 25, 2010 11:45 am

Re: Train pathfinding

Post by Suspect » Sun Apr 25, 2010 3:21 pm

Sorry I haven't explained myself properly. I am playing on train table mode. I am not looking to win the game with train efficiency etc. I am trying to make realistic-looking sections of track, and to have busy section where a lot of trains are using them. Perhaps I am expecting too much from the game, but this is why I asked if there is anyway to improve train pathfinding?

User avatar
Jancsika
Posts: 921
Joined: Thu Nov 02, 2006 3:40 pm
Location: Maryland

Re: Train pathfinding

Post by Jancsika » Sun Apr 25, 2010 3:46 pm

Whether you want to make money or play it in TrainTable mode, the answer still lies in the proper laying of the tracks
You have to avoid loops!!.
There is no practical way to force the AI to stick to the route it started on. It will constantly revise its path, and when it will find its path temporary blocked, it will change and double back,….and double back,……over and over.
You can build dedicated tracks, one train to one track, no switches.
But that's not realistic.
Jancsika :D

Suspect
Posts: 5
Joined: Sun Apr 25, 2010 11:45 am

Re: Train pathfinding

Post by Suspect » Sun Apr 25, 2010 4:19 pm

So maybe my question should be:

Is it possible to alter the AI? and if so, how?

Thanks :D

User avatar
Jancsika
Posts: 921
Joined: Thu Nov 02, 2006 3:40 pm
Location: Maryland

Re: Train pathfinding

Post by Jancsika » Sun Apr 25, 2010 4:30 pm

This game is 4 years old.
Many brave people had the same question, it has been tried, discussed, experimented with. ......but the answer was always NO. :lol:
This is something we just have to live with, because the makers of the game won't do any more revisions.
Look at it this way:
"It gives you more chellenge to overcome." :D
Jancsika :wink:

keotaman

Re: Train pathfinding

Post by keotaman » Tue Apr 27, 2010 4:24 am

Suspect wrote:...I am trying to make realistic-looking sections of track, and to have busy section where a lot of trains are using them. Perhaps I am expecting too much from the game, but this is why I asked if there is anyway to improve train pathfinding?
Short answer: yes! I had 24 trains in the NE game, running up & down the Wash-NY corridor, with NO problems. While this is no guarantee (the game engine sometimes overlooks empty tracks & waits for a full one to become clear), it will improve the pathfinding. I use Routing Difficulty Level: Hard.
Use double, triple, even quad tracks where appropriate, but don't mix lefthand & righthand crossovers -- use one or the other type; this way train conflicts will tend to sort themselves out most of the time. I prefer RH crossovers, while the game engine has shown a slight preference for LH running - go figure, eh?
Anyway, try it & see if your pathfinding improves, and let us know how you make out, please.
A demo game is attached.

Post Reply