The International Simutrans Forum

Development => Technical Documentation => Topic started by: THLeaderH on July 24, 2017, 10:19:56 AM

Title: Reversed order of way construction
Post by: THLeaderH on July 24, 2017, 10:19:56 AM
In wegbauer_t::calc_route(), coordinates are set in the route vector in the order that players do so. However, I found that this order is reversed when the tail of the newly constructed roads is connected to other way and the head is not. The order of coordinates is so important in implementing the direction restriction for oneway road. How can I know if the order is reversed or not in wegbauer_t?
Title: Re: Reversed order of way construction
Post by: prissi on July 24, 2017, 04:59:38 PM
As mentioned before: I think the overtaking patch and a oneway way/wayobj patch should be separated. Otherwise it gets more and more difficult to properly merge them.
Title: Re: Reversed order of way construction
Post by: Dwachs on July 24, 2017, 06:25:50 PM
YOu can also reverse the route in calc_route again.
Title: Re: Reversed order of way construction
Post by: THLeaderH on July 25, 2017, 12:21:15 AM
QuoteAs mentioned before: I think the overtaking patch and a oneway way/wayobj patch should be separated. Otherwise it gets more and more difficult to properly merge them.
Leaving oneway_mode road itself two way means we have to deal with facing traffic. I found that this becomes a big problem considering city cars. So, oneway road feature should not be removed from OTRP. I'll release the next version, v11, in about a week.
Of course, I update the base of code to the latest version of the trunk to make merging easy. Also, oneway way feature is written in specific files, wegbauer.h, wegbauer.cc, tunnelbauer.h, tunnelbauer.cc, brukenbauer.h, and brukenbauer.cc. When you want to inspect this feature, you have to check these 6 files.
Title: Re: Reversed order of way construction
Post by: prissi on August 01, 2017, 10:28:03 AM
I would see overtaking roads like single lane train lines: It is the task of the player to work them properly. So while I am in favour of merging relaxed overtaking roads, I am not so keen in automatically built single way roads.
Title: Re: Reversed order of way construction
Post by: THLeaderH on August 01, 2017, 10:35:15 AM
QuoteSo while I am in favour of merging relaxed overtaking roads, I am not so keen in automatically built single way roads.
Oneway_mode road is always built manually. Automatically built roads such as city roads are always twoway_mode, which means the conventional condition is applied. However, city roads can be oneway_mode automatically only when it is rebuilt from players' roads.