News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

One-way Roads

Started by Andyh, August 21, 2011, 06:14:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andyh

I've been thinking about one-way roads recently.  I know the 'official' position is that one way streets are not possible due to limitations in the base Simutrans code (that is to say true one way streets - with 2 lanes of traffic going in the same direction - are not possible; you can prevent access to a street from one direction, eliminating the use of one lane, but that's not really a true one-way street).

However, I've had idea for solving this and I would like to get people's feedback as to how feasible this is.

I've been playing around with elevated ways and I've noticed that you can build an elevated road over the top of an existing (ground level) road.  An elevated road is distinguished from a regular road in that the 'system_type' variable is set to 1 instead of 0 for a regular road.  So my idea is essentially this: create a new system_type (say, 99) for roads which would be exactly like regular, ground level roads except that they are configured for left side travel (assuming we're using a North America/Continental Europe style map). 

To create a one way street one would build a regular (system_type = 0) road and overlay a left hand travel (system_type=99) road directly on top of it.  Then put in 'no-entry' signs for both roads to restrict traffic flow to a single direction.

Any thoughts as to feasibility?  The biggest challenges, it seems to me, would be (1) configuring the new system_type for left hand travel in a right hand travel 'universe', and (2) figuring out a way for vehicles to interchange between regular roads and the 'system_type 99' roads.  Perhaps someone with knowledge of the Simutrans code could comment on these.

prissi

How to decide which cars to use the second lane?

Simutrans has overtakign code. Without traffic coming against, overtaking will happen often and the second lane will be used already now (overtaking was a little broken in the stable and happen much less frequently there).

ӔO

maybe on a one way road, give a more sensitive overtaking code?
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

IgorEliezer

#3
In my opinion, citycars should use the opposite lane and leave free the main lane for player vehicles, since citycars are mostly the main cause of traffic jams.

For example in my country (a right-hand traffic one), slower and heavier vehicles like buses and trucks use the right lane (the outer lanes) while the faster ones, like motorcycles and cars, use the left lane (the inner lanes).

Quote from: prissi on August 21, 2011, 07:35:11 PM
How to decide which cars to use the second lane?
As I stated above, all citycars should use the second lane in one-way road. And, considering the player vehicles should have priority over the road (because citycars are just decoration), player vehicles will always use the first lane, in any circumstance, in both one- and double-way roads.

If the tile has a specific flag that "tells" Simutrans that road is a one-way road, all citycars will run in second lane while the player's ones will run as of today. If no "specific flag" is given, the citycars will run as of today. I think this schema is quite consistent, simpler to implement, will cause less harm to the code and the player will be thankful. I believe the player would use one-way roads mostly when he faces constant traffic jams in his streets and wants a free lane for his buses and trucks, then he'll use the one-way feature. If the player starts to use one-way just for fun or mindlessly, he's just wasting money.

In short: just citycar code is changed so that the player can have a free lane for his vehicles specially in the traffic-jam-prone roads through one-way feature, while player vehicle code is kept untouched.

Deal? ;D

Quote from: prissi on August 21, 2011, 07:35:11 PMSimutrans has overtakign code. Without traffic coming against, overtaking will happen often and the second lane will be used already now (overtaking was a little broken in the stable and happen much less frequently there).
Overtaking mostly only happens in very long intercity roads, meaning the player rarely takes advantage of this feature. :S

Therefore, overtaking would only take place in non-one-way roads.

An_dz

Good idea Igor,

I was just going to suggest if the vehicle can reach the max road speed uses the left lane, if not uses the right one and uses the overtaking feature if reach a slower vehicle, and obviously just do overtaking when there's no car coming on the left lane. But this will just work with High Speed tracks. Maybe add something aleatory to choose the lane the car will use, but just if the vehicle can reach the max speed.

But your idea looks more cool for play enjoyment purpose.

Fabio

Left hand lane/road should also be used by vehicles turning left at the next intersection (at least in the tile before the turn).

Andyh

Quote from: prissi on August 21, 2011, 07:35:11 PM
Simutrans has overtakign code. Without traffic coming against, overtaking will happen often and the second lane will be used already now (overtaking was a little broken in the stable and happen much less frequently there).

The overtaking feature is a nice one, but in my opinion it suffers from a major flaw: it does not permit overtaking multiple vehicles simultaneously.  This severely limits its effectiveness in a one-way street (i.e. one with a no-entry sign at one end) because as soon as traffic gets heavy overtaking ceases, even if there is no traffic at all in the left lane.  The result is that in an urban one-way system in Simutrans half of every road is never used; this means that a one-way system actually increases congestion rather than reducing it.  If the overtaking code could be modified to allow overtaking multiple vehicles then the existing system of no-entry signs would be much more useful.

Quote from: prissi on August 21, 2011, 07:35:11 PM
How to decide which cars to use the second lane?

I assume you mean 'how would the code determine which cars should use the second lane (i.e. the left lane in a right side travel universe)'.  My initial thought was: (1) citycars choose the main or second lane at random at each intersection; (2) the existing route-finding code determines whether player vehicles use the second lane; in other words a player vehicle will look at the second lane simply as an alternative route and select it if it is favored by the routing algorithms.

I also like Igor's idea of reserving one lane for player vehicles (but perhaps it would be easier to code if citycars kept to the 'main' lane and player vehicles could use either).

prissi

I pak64 citycars are usually slower (in the 1940ies) than most trucks. Same for later intercity buses. Also I have games with serious congestion without any citycars (using ~3000 buses). This suggestion of citycars using left lane does not solve any porblems mentioned.

The only proper way would be a better overtaking code to allow overtaking, when there is an overtaking vehicle in front with the same or faster maxspeed. Should not be a very difficult change.

The queuing up behind a slow vehicle would neither approach solve ...