A direct train makes the ticket screen easy. Pick a departure, choose a fare, and add a seat if the train has assigned seating. When I built the StillDeep Transport demo, I wanted the same screen to handle a trip that crosses two lines. The first thing I had to decide was what “best route” should mean at a ticket desk.
Choosing where to change trains
Several lines in the demo meet at more than one station. Before I look at individual departures, I compare possible routes by adding the reference fares of their legs. When those totals tie, the engine prefers fewer legs. If there’s still a tie, it prefers the shorter distance.
That order matters. A short route on the map can still be a more expensive trip. And two routes with the same fare can ask very different things of a passenger carrying luggage. Using leg count to break the tie makes the choice predictable at the counter.
Turning the route into a trip someone can buy
Once I have the route, I need departures that actually connect. Think of a first train that arrives at 13:20 and a second that leaves at 13:10. Both trains serve the right stations, but the passenger can’t make that trip. Finding the transfer station and finding a usable pair of trains are separate checks.
I wanted the result to be easy to verify at the counter. The screen shows where the passenger changes trains and puts both legs in the same cart. The screenshot shows a trip from the North Station to Mont-aux-Bleuets with a change at Central Station.
If you’re building an interface for a similar system, try the same origin and destination against departures that leave before and after the arrival of the first train. The map can look identical in both cases. The ticket screen should only offer the connection the passenger can catch.
See the transfer screen and the rest of the StillDeep Transport demo write-up.
Adapted from my original development notes and screenshots with AI assistance.



