The International Simutrans Forum

 

Author Topic: smooth pass of choose signals  (Read 657 times)

0 Members and 1 Guest are viewing this topic.

Offline THLeaderH jp

  • Coder/patcher
  • Devotee
  • *
  • Posts: 328
  • Languages: JP,EN
smooth pass of choose signals
« on: December 24, 2018, 01:35:09 PM »
Hello, everyone.
In the current simutrans, a train slows down to 50km/h when passing a choose signal. This is because rail_vehicle_t::is_choose_signal_clear() cannot be processed in sync_step(). Stopping a train is necessary to process that in step().
So, I made a patch that enables is_choose_signal_clear() processed in step() even when the train is moving. Trains can pass a choose signal smoothly without slowing down. Internally, a convoy issues a choose signal judgement request when is_choose_signal_clear() is called in sync_step(). And the convoy processes the request in step().

A train slows down before a choose signal when the train enters a platform that is not designated in the schedule. Some of you might say that it is natural to slow down before choose signals because in general trains slow down when entering a side truck. However, when the train is scheduled to enter the side truck, the train does not slow down while it enters the side truck. Speed control should be done with a way and a wayobj, not with a choose signal. A choose signal itself should make trains pass without a slowdown.

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1325
Re: smooth pass of choose signals
« Reply #1 on: December 24, 2018, 08:01:25 PM »
Seems a more complicated way to do:  [BUG?] Train choose signals force speed reduction to 50 km/h for other platform.  yet with all the same issues/objections.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9514
  • Languages: De,EN,JP
Re: smooth pass of choose signals
« Reply #2 on: December 25, 2018, 03:19:06 AM »
Since processing in step means processing every five or six frames, the train will then come to a sudden stop, if there is no free route. This was less obvious with slower speeds, so therefore the slowdown. You will need large maps with many traisn to notify that, and probably also a longer search path (i.e. many platforms etc.)

Offline THLeaderH jp

  • Coder/patcher
  • Devotee
  • *
  • Posts: 328
  • Languages: JP,EN
Re: smooth pass of choose signals
« Reply #3 on: December 25, 2018, 03:09:12 PM »
Since processing in step means processing every five or six frames, the train will then come to a sudden stop, if there is no free route. This was less obvious with slower speeds, so therefore the slowdown. You will need large maps with many traisn to notify that, and probably also a longer search path (i.e. many platforms etc.)
Trains slows down just as the conventional simutrans as long as the choose signal judgement is not processed. This patch does not cause a sudden stop. It is true that trains may slow down if the trains are too fast and the map is so huge, but this behavior is almost same as the conventional and does not harm trains' movement. If the map is not so huge and trains are slow enough, trains can pass a choose signal without a slowdown, and that is the benefit of this patch.