The International Simutrans Forum

 

Author Topic: Why do trains always advance to the end of stations?  (Read 495 times)

0 Members and 1 Guest are viewing this topic.

Offline THLeaderH jp

  • Coder/patcher
  • Devotee
  • *
  • Posts: 271
  • Languages: JP,EN
Why do trains always advance to the end of stations?
« on: October 13, 2018, 12:11:42 PM »
Hello. I have a question.

In current simutrans, all rail vehicles go until they reach the end of the stations, even if the destination is the middle of the platform. This is obviously intended as it can be seen in the source code.
Code: [Select]
// use length 8888 tiles to advance to the end of all stations
return route->calc_route(welt, start, ziel, this, max_speed, 8888 /*cnv->get_tile_length()*/ );

It seems more reasonable for me to use cnv->get_tile_length() than 8888, that forces trains to advance to the end. Could anyone tell me why simutrans does so?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Why do trains always advance to the end of stations?
« Reply #1 on: October 13, 2018, 01:49:26 PM »
It has been like that forever. And it does not matter, whether it always goes to the end or just as much as it fits into the station. Going less tiles would be faster (assuming the train returns immeadiately), but alsoo would reduce the revenue (less tiles travelled).

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: Why do trains always advance to the end of stations?
« Reply #2 on: October 13, 2018, 02:37:55 PM »
Going less tiles would be faster (assuming the train returns immeadiately), but alsoo would reduce the revenue (less tiles travelled).
Would it not also reduce the running costs?

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2524
  • Languages: EN
Re: Why do trains always advance to the end of stations?
« Reply #3 on: October 14, 2018, 12:55:56 AM »
Quote
Would it not also reduce the running costs?
Yes it would, however due to how running costs and income work in standard it will either mean less loss (revenue less than running cost per tile) or less profit (revenue more than running cost per tile). Since one generally only runs trains with less running cost than revenue per tile on average, going to the end of platform makes sense from that perspective.

This is different in extended however. There journey time plays an important part, and hence stopping earlier would give value even if it means less profit for the above reasons.

Offline THLeaderH jp

  • Coder/patcher
  • Devotee
  • *
  • Posts: 271
  • Languages: JP,EN
Re: Why do trains always advance to the end of stations?
« Reply #4 on: October 14, 2018, 07:27:42 AM »
Since the answer to the question whether trains should always advance to the end of platform seems to depend on the situation, why don't we make it configurable? In other words, we prepare "advance_to_end" option and users can choose whether trains go until they reach the end of the stations. True means trains always advance to the end and it is more reasonable to set the default value true, from a perspective of compatibility.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: Why do trains always advance to the end of stations?
« Reply #5 on: October 14, 2018, 08:03:44 AM »
Every configuration option adds to the list of things that has to be taken into account when doing other changes in the future and tested with all possible values (ideally before every release).

It also means that it gets more difficult to offer help and advice to other players, because the things that work well the way you have configured Simutrans, may be disastrous for someone running with different settings. Just see how DrSuperGood could come up with three different answers to my simple question (although the answers go a bit beyond just answering the question). And I think there are more possible answers depending on the payment mode configuration. The same is true for debugging, when bugs only appear in certain configurations.

Offline THLeaderH jp

  • Coder/patcher
  • Devotee
  • *
  • Posts: 271
  • Languages: JP,EN
Re: Why do trains always advance to the end of stations?
« Reply #6 on: October 14, 2018, 09:14:12 AM »
OK, I'm very sorry. There is no need of configuration.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2524
  • Languages: EN
Re: Why do trains always advance to the end of stations?
« Reply #7 on: October 14, 2018, 09:17:51 AM »
If it were implemented it would probably be a per stop setting in the schedule.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: Why do trains always advance to the end of stations?
« Reply #8 on: October 14, 2018, 12:35:08 PM »
If it wasn't for chose sign(al)s complicating things, one could just let the waypoint decide where the (road) train stops.