News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

smooth pass of choose signals

Started by THLeaderH, December 24, 2018, 01:35:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

THLeaderH

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.

TurfIt


prissi

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.)

THLeaderH

Quote from: prissi 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.)
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.