The International Simutrans Forum

 

Author Topic: Motorways/overtaking  (Read 7786 times)

0 Members and 1 Guest are viewing this topic.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Motorways/overtaking
« on: February 10, 2011, 01:14:01 AM »
Although the one way/"start of motorway" sign can be defined in a pakset, it appears that it is not as useful as it might be because of limitations to the overtaking feature, as the offside lane is rarely used unless there is a long, straight stretch of road on which a fast overtaking manoeuvre can be accomplished quickly. Otherwise, if there is heavy traffic, as depicted in the screen shot, only the nearside lane is used, greatly reducing the effective capacity. A related problem is that vehicles joining the motorway will stop the traffic in the nearside lane, causing long queues, but vehicles will never move to the offside lane to overtake the joining traffic as they would in reality. This also makes it difficult to design effective road junctions, as roundabouts rely on the ability of traffic to overtake newly joining traffic.

What I suggest is a one way road flag in a road's .dat file: a vehicle travelling on a road flagged as one way would have a modified overtaking algorithm such as it would not test for whether the way is clear for it to pull back into its own side of the road after overtaking, and would only pull back into its own side (1) if and when it is clear; or (2) if the next tile is not a one-way flagged tile and the normal overtaking conditions are not met (in which case it would wait in the offside lane if necessary). This would greatly improve the ability to add road capacity to heavily trafficked areas and design effective road junctions.

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Motorways/overtaking
« Reply #1 on: February 10, 2011, 08:23:51 AM »
I support it greatly, as I'm painting a good number of motorways :)
The biggest issue would be: how do you tell the program if a newly laid motorway is e.g. northbound or southbound?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Motorways/overtaking
« Reply #2 on: February 10, 2011, 09:42:16 AM »
One could use the existing "start of motorway" signs for that, which already serve that purpose; although it may be possible to have an even more elegant solution.

Offline IgorEliezer br

  • Devotee
  • Administrator
  • *
  • Posts: 4088
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Motorways/overtaking
« Reply #3 on: February 10, 2011, 10:05:38 AM »
although it may be possible to have an even more elegant solution.

If not a sign, then a road with a special flag that tells the program that part of road is a motorway (as said). But I'm just a bit worried about it because it was denied once, IIRC.

I don't care much that my vehicles (player vehicles) don't use the 2nd lane, but the citycars are terribly annoying when they overcrowd the roads and my vehicles get stuck. Citycars could use the 2nd lane so that the 1st lane is free for my vehicles.

But still, how the program will check the tile after a turn or intersection is a motorway?
« Last Edit: February 10, 2011, 10:19:14 AM by IgorEliezer »

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Motorways/overtaking
« Reply #4 on: February 10, 2011, 11:14:35 AM »
1)
There could be a double signal: One-way-start and One-way-end, placed together (click to start, then click to end) on a stretch of road without intersections. It changes the RIBI in each tile from start to end to make it monodirectional.
Deleting start or end signal will delete also its twin and reverts RIBIs to original. Intersection are forbidden in a one way stretch. This could be rather straightforward.

2)
There could be One-way-start and One-way-end signals, independent. Pathfinding will know: if the path crosses a start and subsequently an end, the vehicles will use enhanced lane method, if only one of them, normal behaviour, as there is likely to be a road design error. This would leave citycars out. Citycars could use enhanced lane method from the start signal till either they meet an end signal, or they meet another vehicle coming from the "wrong" direction.

Offline paco_m

  • *
  • Posts: 170
Re: Motorways/overtaking
« Reply #5 on: February 10, 2011, 11:42:24 AM »
As far as I know the traffic signs are valid only for the tile where they are placed, the next tile would be considered normal road unless you place the highway sign at each tile ;D

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2908
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: Motorways/overtaking
« Reply #6 on: February 10, 2011, 12:45:16 PM »
I support it, I think this is easier than making a sign change the road algorithm. But if we have a big motorway and only five cars, all of them will drive on the right or some on the left too?

Offline paco_m

  • *
  • Posts: 170
Re: Motorways/overtaking
« Reply #7 on: February 10, 2011, 01:13:33 PM »
But if we have a big motorway and only five cars, all of them will drive on the right or some on the left too?
when the right lane is free they should always drive there; this is also what the law in RL says, however nobody cares about it :D

Offline mwoodburn81

  • *
  • Posts: 81
Re: Motorways/overtaking
« Reply #8 on: February 10, 2011, 02:30:14 PM »
Quote
A related problem is that vehicles joining the motorway will stop the traffic in the nearside lane, causing long queues, but vehicles will never move to the offside lane to overtake the joining traffic as they would in reality.

Slightly off-topic.  But one thing I think would be cool would be when you click on an intersection, to have the ability to select weather it is a road-intersection is a two-way or four-way stop or if it is traffic light controlled.

That way you can make footer and on-ramps yield to thruways.  

I would love to see more realistic one-way/two line road-ways in simutrans.

Cars could have a lane-bias. which could change based upon their-speed relative to other cars around them (especially the car in front of them)  weather or not they have to turn left or right at an upcoming intersection and current traffic levels.  When their bias changes, they can change lanes if the lane next to them is free. 

Also.  if the car is from Boston or NJ, the car should be  driving in the break down lane frequently , and switch lanes often and aggressively.
 
« Last Edit: February 10, 2011, 02:47:25 PM by mwoodburn81 »

Offline The Hood

  • Devotee
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Motorways/overtaking
« Reply #9 on: February 10, 2011, 06:35:04 PM »
I like this idea.  Is it at all possible a direction flag could be added to certain dats (e.g. one_way=1), so that it can only be used in the direction the way was laid (i.e. from click to release or first to second click)?  This would be especially good if the graphics engine could recognise which way was which so you could draw motorways correctly in each direction with the hard shoulder and central reservation in the correct place.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Motorways/overtaking
« Reply #10 on: February 10, 2011, 11:12:47 PM »
I like this idea.  Is it at all possible a direction flag could be added to certain dats (e.g. one_way=1), so that it can only be used in the direction the way was laid (i.e. from click to release or first to second click)?  This would be especially good if the graphics engine could recognise which way was which so you could draw motorways correctly in each direction with the hard shoulder and central reservation in the correct place.

This would indeed be a good implementation and could substantially enhance road transport in Simutrans.

Offline IgorEliezer br

  • Devotee
  • Administrator
  • *
  • Posts: 4088
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Motorways/overtaking
« Reply #11 on: February 11, 2011, 12:25:33 AM »
Yo Dawg! I hear you like models, so I made one :D :



Feel free to use it.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Motorways/overtaking
« Reply #12 on: February 12, 2011, 12:43:18 AM »
One other related issue with overtaking is that, often vehicles pull back in from overtaking so soon that they cause the vehicle that they were overtaking to stop behind them. Although vehicles often "cut up" other vehicles in the real world, we probably don't want to simulate it this way in Simutrans! It can be somewhat disruptive to the vehicle being overtaken, which should be unaffected by the overtaking vehicle.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9595
  • Languages: De,EN,JP
Re: Motorways/overtaking
« Reply #13 on: February 12, 2011, 08:28:49 PM »
This is solved in standard (at least in my tests). Maybe the code in experimental with different aceleration needs tweaking of the parameters guessing the free pace needed for overtaking?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Motorways/overtaking
« Reply #14 on: February 13, 2011, 12:38:19 PM »
Hmm - the only code that I can find that involves private cars checking the time that it will take them to overtake another vehicle does not seem to involve any checking of acceleration, but rather assuming that the overtaken vehicle will remain at a constant speed:

Code: [Select]
time_overtaking -= (ribi_t::ist_gerade(str->get_ribi()) ? 256<<16 : diagonal_length<<16)/kmh_to_speed(str->get_max_speed());

Is this the code to which you are referring, or is it elsewhere? (The relatively simplified physics of city cars has not been changed in Experimental).

Edit: Another possibility for the interface of such a tool would be that, whenever a motorway-flagged road is laid, two such roads would be laid in parallel to each other, each automatically marked as the other's pair, such that the direction in which the traffic travels on each is determined by whether the left hand drive setting is engaged in simuconf.tab.

Offline Junna

  • Devotee
  • *
  • Posts: 1082
Re: Motorways/overtaking
« Reply #15 on: February 14, 2011, 09:26:28 AM »


Is this the code to which you are referring, or is it elsewhere? (The relatively simplified physics of city cars has not been changed in Experimental).

Edit: Another possibility for the interface of such a tool would be that, whenever a motorway-flagged road is laid, two such roads would be laid in parallel to each other, each automatically marked as the other's pair, such that the direction in which the traffic travels on each is determined by whether the left hand drive setting is engaged in simuconf.tab.

Would this work even with a one-tile separation (it looks funky to have two motorway carriageways next to each other with no barrier between them)? Or perhaps a barrier could be incorporated somehow.

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Motorways/overtaking
« Reply #16 on: February 14, 2011, 10:50:16 AM »
Or perhaps a barrier could be incorporated somehow.
Barriers can be already incorporated in pakset.
For Pak128, future 130 km/h ans 200 km/h motorways will have safety barriers both central and on the shoulder.