Railway/Train path finding: Difference between revisions
Jump to navigation
Jump to search
Line 19: | Line 19: | ||
* [https://www.factorio.com/blog/post/fff-68 FFF #68] | * [https://www.factorio.com/blog/post/fff-68 FFF #68] | ||
* [http://www.factorioforums.com/forum/viewtopic.php?f=30&t=4834 bug ticket] | * [http://www.factorioforums.com/forum/viewtopic.php?f=30&t=4834 bug ticket] | ||
* [http://www.factorioforums.com/forum/viewtopic.php?f= | * [http://www.factorioforums.com/forum/viewtopic.php?f=11&t=8795&p=70586#p70586 Changed weighting] | ||
* [http://www.factorioforums.com/forum/viewtopic.php?f=30&t=8795 Changed weighting] | * [http://www.factorioforums.com/forum/viewtopic.php?f=30&t=8795 Changed weighting] | ||
* [http://www.factorioforums.com/forum/viewtopic.php?f=30&t=2237#p62195 Bug ticket explained] |
Revision as of 06:56, 7 March 2015
< Railway | Train path finding
Before a train rides to a target Railway/Train stop, it calculates the best route, based on the railway network at that time.
For calculation it uses a simple A*-algorithm, with the following special weighting-rules:
- When the rail block is occupied by a train -> penalty of 2 * length of the block divided by block distance from the start, so the far away occupied paths don't matter much.
- When there is a train waiting in the station -> penalty of 6 tiles per every remaining second in the station (This also helps the train to choose the best station even when all of them are occupied).
The route is recalculated if the train would need to stop (which means also, if the invisible front, the so called train_stop_point) needs to stop. See Debug mode and turn show_train_stop_point on, to see that point. It is also recalculated after a train has stopped on a signal.
History
The current algorithm is introduced with v0.11.11.
Before that the algorithm was simply, if the next block is occupied, take another route.
See