News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

(OTRP) can't overtake on a one-way bus stop

Started by Ranran(Hibernating), May 27, 2022, 12:12:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ranran(Hibernating)

Convoys can be overtaken on a two way bus stop(*), but not on a one way bus stop.
This did not exist when the overtaking patch was introduced Extended-14.0 as far as I could see, but then I confirmed that it could be reproduced as of Extended-14.3 after teamhimeh modified the code himself.


Suppose there is a bus that stops on the front tile and a bus that stops on the back tile. The bus that is about to stop in the back expects to be able to overtake and proceed to the tile in the back if the bus in front is stopped.
In the case of two way mode (default), it works as expected.



However, in one way mode, although I try to overtake, it seems that I can not enter the tile in the back because of the obstruction by the bus in front.  ???

It can be said that this impairs this function. (´・ω・`)

Halt mode may prevent the passing lane. Therefore, it should be possible to use it properly with one way mode. Also, as I pointed out earlier, I don't like halt mode because it ignores the direction of the door and the image of the bus stop and stops at the passing lane to create a strange sight. (´・ω・`)

Ideally, I should stop in the left lane in this case as well.


I investigated where in can_enter_tile(), which prohibits entry into the tile, is returning false.
The problem is line 4052 in vehicle/simvehicle.cc for this pull request by teamhimeh. This statement now returns false at one way bus stops.
EDIT:
In extended, the relevant code has now been moved to road_vehicle.cc.

EDIT: (*) In 2019(14.9) this feature was further broken
(´・ω・`)シミュトランスのアップデート履歴(日本語) (※更新停止中)
bit.ly/3AuKHHP

Ranran(Hibernating)

#1
This bug produces this strange stuck.

(The double decker bus appears to be on the front tile due to image offset, but is on the same tile as the red bus.)

A double-decker bus that failed to overtake and a bus waiting for a schedule generated a barricade, causing the bus to pass through that stop to stop.
(´・ω・`)シミュトランスのアップデート履歴(日本語) (※更新停止中)
bit.ly/3AuKHHP

Ranran(Hibernating)

#2
I made a save game to check for bugs in the overtaking feature at these bus stops.
Note that the behavior will change significantly if the bus stop tile and its one preceding tile have different overtaking settings.
Behavior also changes depending on the number of tiles and the stop position.

        // If the next tile is our destination and we are on passing lane of oneway mode road, we have to wait until traffic lane become safe.
        if(  cnv->is_overtaking()  &&  str->get_overtaking_mode()==oneway_mode  &&  route_index == r.get_count() - 1u  ) {
            halthandle_t halt = haltestelle_t::get_halt(welt->lookup(r.at(route_index))->get_pos(),cnv->get_owner());
            vehicle_base_t* v = other_lane_blocked(false, offset);
            if(  halt.is_bound()  &&  gr->get_weg_ribi(get_waytype())!=0  &&  v  &&  v->get_waytype() == road_wt  ) {
                restart_speed = 0;
                cnv->reset_waiting();
                cnv->set_next_cross_lane(true);
                return false;
            }
            // There is no vehicle on traffic lane.
        }
I tried to remove the following code referring to my previous post, but in that case the overtaking is successful, but even if there is already a vehicle at the target bus stop, the convoy overlaps as a result of the intrusion on the tile.
What this suggests is that the vehicle tile blocking the entry may be off by one tile. But I have no confirmation.

I would be grateful if someone could help us towards the resolution of this bug.
(´・ω・`)シミュトランスのアップデート履歴(日本語) (※更新停止中)
bit.ly/3AuKHHP