News:

Want to praise Simutrans?
Your feedback is important for us ;D.

Motorways/overtaking

Started by jamespetts, February 10, 2011, 01:14:01 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Fabio

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?

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

IgorEliezer

#3
Quote from: jamespetts on February 10, 2011, 09:42:16 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?

Fabio

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.

paco_m

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

An_dz

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?

paco_m

Quote from: An_dz on February 10, 2011, 12:45:16 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

mwoodburn81

#8
QuoteA 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.

The Hood

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.

jamespetts

Quote from: The Hood 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.

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

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

IgorEliezer

Yo Dawg! I hear you like models, so I made one :D :



Feel free to use it.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

prissi

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?

jamespetts

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:


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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Junna

Quote from: jamespetts on February 13, 2011, 12:38:19 PM


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.

Fabio

Quote from: Junna on February 14, 2011, 09:26:28 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.