The International Simutrans Forum

 

Author Topic: One-way Roads  (Read 4345 times)

0 Members and 1 Guest are viewing this topic.

Offline Andyh

  • *
  • Posts: 74
One-way Roads
« on: August 21, 2011, 06:14:56 PM »
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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9568
  • Languages: De,EN,JP
Re: One-way Roads
« Reply #1 on: August 21, 2011, 07:35:11 PM »
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).

Offline ӔO

  • Devotees (Inactive)
  • *
  • Posts: 2345
  • Hopefully helpful
  • Languages: en, jp
Re: One-way Roads
« Reply #2 on: August 21, 2011, 09:19:08 PM »
maybe on a one way road, give a more sensitive overtaking code?

Offline IgorEliezer br

  • Devotee
  • Administrator
  • *
  • Posts: 4087
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: One-way Roads
« Reply #3 on: August 21, 2011, 10:03:46 PM »
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).

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

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).
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.
« Last Edit: August 21, 2011, 11:34:47 PM by IgorEliezer »

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2908
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: One-way Roads
« Reply #4 on: August 21, 2011, 10:49:24 PM »
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.

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: One-way Roads
« Reply #5 on: August 22, 2011, 07:50:01 AM »
Left hand lane/road should also be used by vehicles turning left at the next intersection (at least in the tile before the turn).

Offline Andyh

  • *
  • Posts: 74
Re: One-way Roads
« Reply #6 on: August 22, 2011, 08:45:52 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.

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).

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9568
  • Languages: De,EN,JP
Re: One-way Roads
« Reply #7 on: August 27, 2011, 08:35:57 PM »
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 ...