Draw the rail path
Posted: Wed Feb 10, 2016 10:12 am
In FFF #113 the autorouter for rail building was presented. It looks like it finds the shortest path between two endpoints. The update in FFF #114 (bottom animation) shows some manual incremental building of a junction.
This got me thinking about how to best convey the intent of the user where the rail should go. Especially when there are already rail tiles on the ground or you want to build two parallel rails in a curved section. When going around an edge (lake) the shortest path is touching the edge, so both rails would overlap. Sometimes they shall overlap, sometimes they shall not. Sometimes you want little distance, sometimes you want a bigger distance between them. There probably isn't a optimization rule to cover all reasonable cases and we likely don't want a big configuration panel for the autorouter.
Now, my idea is that instead of finding the best path between two endpoints, the player can draw a path (like a pencil drawing) and the autorouter tries to follow the drawn path instead of finding the shortest route.
With this method, the path building of FFF #114 should be possible in one go. When you draw a straight path through a forest like in FFF #113, the shortest path is still curving through the forest, so when drawing straight paths both methods should be identical.
This got me thinking about how to best convey the intent of the user where the rail should go. Especially when there are already rail tiles on the ground or you want to build two parallel rails in a curved section. When going around an edge (lake) the shortest path is touching the edge, so both rails would overlap. Sometimes they shall overlap, sometimes they shall not. Sometimes you want little distance, sometimes you want a bigger distance between them. There probably isn't a optimization rule to cover all reasonable cases and we likely don't want a big configuration panel for the autorouter.
Now, my idea is that instead of finding the best path between two endpoints, the player can draw a path (like a pencil drawing) and the autorouter tries to follow the drawn path instead of finding the shortest route.
With this method, the path building of FFF #114 should be possible in one go. When you draw a straight path through a forest like in FFF #113, the shortest path is still curving through the forest, so when drawing straight paths both methods should be identical.