The International Simutrans Forum

 

Author Topic: Proof of concept: one-way, two-lane avenues?  (Read 24660 times)

0 Members and 1 Guest are viewing this topic.

Offline isidoro

  • Devotee
  • *
  • Posts: 1129
Proof of concept: one-way, two-lane avenues?
« on: December 08, 2011, 11:31:18 PM »
Thinking about the recurrent idea of building "real" one-way, two-lane avenues, I was wandering if the concept is, in fact, very different from that of overtaking.

When I started developing the overtaking patch, the concept was very simple.  Overtaking was, in essence, "temporarily drive on the left".  ST was then prepared for vehicles to drive on the left.  Therefore, the patch only had to do this:
  • If a vehicle would be forced to stop because other slower one was in front of it, it checked if it was safe to overtake (no facing traffic, only one vehicle in front, etc.). Then,
  • ST calculated how much time it would take to overtake, considering the speed of both vehicles. Then,
  • The vehicle was marked to drive on the left and, when the previously calculated time expired,
  • The vehicle was marked to drive on the right again.

I think the concept may be easily made more general.  One of these four classes can be associated to each road tile:
  • 0: overtaking not allowed (painted with a continuous line)
  • 1: overtaking allowed, traffic in both directions (present behavior)
  • 2: two-line one-direction free traffic
  • 3: two-line one-direction traffic, but vehicles must keep to the right as soon as possible.
The most difficult to program would be class 2, but to me it only means to allow overtaking but making the calculated overtaking time infinite and check once in a while if the vehicle can safely return to the right.  Also check if the vehicle reaches another one on the left lane and stop.

The class of the road will only take two bits for each tile.  Surely there would be some problems.  For instance, you have to combine the tile classes with signals (visible or invisible) to prevent traffic to enter in the wrong direction or the route finder find a route in the wrong direction.  Also, if one of those one-line roads ends, traffic may not go back...  To mention only two that come to mi mind.

What do you people that know the code internals think about this?


Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1326
Re: Proof of concept: one-way, two-lane avenues?
« Reply #1 on: December 09, 2011, 03:55:36 AM »
Implementation wise, for in-city multi-lane one-way avenues with intersections, traffic lights, halts, etc., I don't think the overtaking approach of pre calculating a clear road, then ignoring the normal tile by tile checks would give satisfactory results. Instead, further extending those checks (ist_weg_frei, no_cars_blocking) would be my approach.

I've already done some preliminary work on multi-lane one-way roads, but I was targeting creation of controlled access highways. Avenues could be an extension of that with much more logic added to handle intersections especially. But, of course that means I need to get back to working on it...

Speaking of overtaking, I'm ~80% done with extending the logic there to account for vehicle acceleration, more than one vehicle in front, and several other cases where overtaking would be possible but for the timid Simutrans drivers sticking behind the slow truck infront. With the patch, one-way signs preventing oncoming traffic, and no intersections, the vehicle behaviour is what you're calling class 3.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4594
  • Languages: EN, DE, AT
Re: Proof of concept: one-way, two-lane avenues?
« Reply #2 on: December 09, 2011, 08:17:56 AM »
As a first step it would be nice to have class 3 implemented.

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Proof of concept: one-way, two-lane avenues?
« Reply #3 on: December 09, 2011, 08:45:54 AM »
But would these classes be inherent to the road object (in dats) or simply triggered by signals?

I hope the former, but how could you set the direction of the road?

Offline ojii

  • *
  • Posts: 149
  • Languages: EN, DE, JA
Re: Proof of concept: one-way, two-lane avenues?
« Reply #4 on: December 09, 2011, 10:21:49 AM »
But would these classes be inherent to the road object (in dats) or simply triggered by signals?

I hope the former, but how could you set the direction of the road?


Not sure if simutrans can do this, but would it be possible to have the waybuilder actually build both lanes? This way one could just check for 'drive on left/right' to determine which way is which. Obviously this would force players to build the dual lane avenues/highways with both lanes always right next to each other, which might feel a bit restrictive...

Otherwise, how about adding arrows every n tiles, which can be switched using signals, and by default the direction in which the road is "painted" is taken?

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotees (Inactive)
  • *
  • Posts: 1559
  • Languages: EN,ES,CAT
Re: Proof of concept: one-way, two-lane avenues?
« Reply #5 on: December 09, 2011, 11:33:08 AM »
Can't this be solved by making the way building tool, when dealing with 2 lane contruction ALLWAYS build 2x2 blocks? That whould solve the problem of dead-end ways being reversable and forcing the direction of the lanes automatically. That also marks the lane to be of they type 2 isidoro menctioned.

EDIT: And yea, refering to what fabio menctioned, they should be different .dat entries than normal city roads, we'd have:

1: two-way single lane city road. (maybe here no overtanking allowed)
2: two-way single lane roads (with various speeds, with overtaking)
3: two-way double lane city AVENUE. (free driving and lane choosing on vehicles)
4: two-way double lane highway. (driving on the right prefered, but overtaking as soon as possible).

 This opens the door to make richer graphics for city avenues, with place for pedestrians and good decorations on the separation between both lanes.
« Last Edit: December 09, 2011, 11:43:23 AM by Markohs »

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Proof of concept: one-way, two-lane avenues?
« Reply #6 on: December 09, 2011, 11:44:30 AM »
Can't this be solved by making the way building tool, when dealing with 2 lane contruction ALLWAYS build 2x2 blocks? That whould solve the problem of dead-end ways being reversable and forcing the direction of the lanes automatically. That also marks the lane to be of they type 2 isidoro menctioned.

Wow, this would be just great!

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotees (Inactive)
  • *
  • Posts: 1559
  • Languages: EN,ES,CAT
Re: Proof of concept: one-way, two-lane avenues?
« Reply #7 on: December 09, 2011, 02:26:01 PM »
As a sidenote, this scheme whould allow a implementation of roundabouts to solve intersections, with something simiular to this:


Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3651
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Proof of concept: one-way, two-lane avenues?
« Reply #8 on: December 09, 2011, 04:39:29 PM »
Going back to the idea of limited-access highways....

If this is all successful, I'd like to throw out an idea: Access ramps. Right now, when I build my fake freeways, a full-sized road is needed for entrance/exit ramps; but if there will be rules in place on how to treat streets when building an avenue/highway, perhaps something (I have some possible ideas, but don't know what the code will support) that will enable a special road to connect with what appear to be angled ramps, with a single lane...

Offline Václav

  • Devotee
  • *
  • Posts: 3267
  • formerly VaclavMacurek
  • Languages: CZ, EN
Re: Proof of concept: one-way, two-lane avenues?
« Reply #9 on: December 09, 2011, 06:23:44 PM »
Isaac, idea of highway entrance/exit ramps is nice (and I would like to support this too) - but I am worried about that it would be difficult - owing to that in queue of currently available graphics of roads is nothing usable - or my imagination/fantasy (I am really not sure what word is more suitable to this place  :-[ ) is very short :o

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Proof of concept: one-way, two-lane avenues?
« Reply #10 on: December 09, 2011, 08:35:57 PM »
Graphics is the easiest of issues: they can be painted

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3651
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Proof of concept: one-way, two-lane avenues?
« Reply #11 on: December 09, 2011, 08:38:08 PM »
I imagine that if a system enabling access ramps was created, someone would paint graphics for it. :)

Offline isidoro

  • Devotee
  • *
  • Posts: 1129
Re: Proof of concept: one-way, two-lane avenues?
« Reply #12 on: December 10, 2011, 02:33:25 AM »
[...]I don't think the overtaking approach of pre calculating a clear road, then ignoring the normal tile by tile checks would give satisfactory results. Instead, further extending those checks (ist_weg_frei, no_cars_blocking) would be my approach.

I agree.  In fact, this new, more general approach would also benefit the overtaking code:  present code ends overtaking when the precalculated time expires.  If that is changed, overtaking may be chained, for instance.

If I recall it correctly, there was a flag is_overtaking.  Now it would mean is_on_left_lane.  And this, combined with the class of the road, would make all the logic feasible.

But would these classes be inherent to the road object (in dats) or simply triggered by signals?
I hope the former, but how could you set the direction of the road?

A combination of both: the tile would mark if overtaking is possible/impossible/safe and graphics would mark it with usual lines painted on the road.  But tiles remain bidirectional.  You say what direction is used with the help of signals at the entrances/exits.  Furthermore, some special signals marking a direction could paint the corresponding arrows on the road and serve for vehicles to follow the right direction and not turn back.

Not sure if simutrans can do this, but would it be possible to have the waybuilder actually build both lanes?[...]

My opinion is that that should not be enforced.  That way, the player is free to temporarily separate both roads to avoid a park, for instance.

[...]Access ramps. Right now, when I build my fake freeways, a full-sized road is needed for entrance/exit ramps;[...]

Technically I think that this is quite feasible: roads (for cars) with the behavior of railways:  one direction per tile.


Offline Václav

  • Devotee
  • *
  • Posts: 3267
  • formerly VaclavMacurek
  • Languages: CZ, EN
Re: Proof of concept: one-way, two-lane avenues?
« Reply #13 on: December 10, 2011, 07:01:06 AM »
... of course that it can be painted. It means probably more graphics against basic roads. Left handed stripe, right handed stripe (from view of player of game, of course) - and bridges and elevated ways for them ... for connection of roads that are not in the same level.

... and I forgot on something - busstops - because these roads would may be finally used for creation of busstops out of main stream of transportation.
« Last Edit: December 10, 2011, 07:07:29 AM by VaclavMacurek »

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Proof of concept: one-way, two-lane avenues?
« Reply #14 on: December 10, 2011, 09:24:54 AM »
Vaclav, I see your point. Probably the new graphics should be incorporated in the existing objects, so that the menus would be pretty much unchanged, whereas new graphics would appear according to the context.

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3651
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Proof of concept: one-way, two-lane avenues?
« Reply #15 on: December 10, 2011, 05:53:53 PM »
Have we discussed sub-menus? It could really reduce the clutter in the large menus... Click a button, and a vertical set of buttons appears - maybe even 'squared' (i.e. 16 buttons would be 4x4 grid)

Offline greenling

  • Lounger
  • *
  • Posts: 1728
  • Simutransarchology it my hobby!
  • Languages: DE,EN
Re: Proof of concept: one-way, two-lane avenues?
« Reply #16 on: December 10, 2011, 07:44:31 PM »
Isaac.Eiland-Hall
Your Idea with The Submenus be Great!
Submenus make the Mainmenu thin!

Offline Václav

  • Devotee
  • *
  • Posts: 3267
  • formerly VaclavMacurek
  • Languages: CZ, EN
Re: Proof of concept: one-way, two-lane avenues?
« Reply #17 on: December 10, 2011, 08:05:41 PM »
Vaclav, I see your point. Probably the new graphics should be incorporated in the existing objects, so that the menus would be pretty much unchanged, whereas new graphics would appear according to the context.
I did not talk about menu. I talked only about amount of new graphics.

But back to chief's idea of access ramps ... access points, if they would be built automatically, should not have form as is in SC3:


but it should have form of real road-highway access points - connection stripes (of length at least one tile before end, in game) as is on this picture
.

So, in this case I suggest free building by players.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Proof of concept: one-way, two-lane avenues?
« Reply #18 on: December 11, 2011, 02:34:31 PM »
This is a rather excellent idea - but I do wonder whether, in reality, there is the distinction suggested between classes 2 and 3; certainly, in the UK, the rule is as in class 2: one must use the left-most lane unless overtaking (with a few exceptions, such as right turn lanes, etc.).

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: Proof of concept: one-way, two-lane avenues?
« Reply #19 on: December 12, 2011, 12:09:01 AM »
First off, one-way-two-lanes would be a big relief for players who need to supply a pharmacy or a gas station in a downtown with all those traffic jams. I sometimes ended up building a railway to supply those small markets in the towns because buses and trucks used to lock the streets. But.... a railway here doesn't make some much sense.

But would these classes be inherent to the road object (in dats) or simply triggered by signals?
I prefer by object, because player would intuitively try to build an one-way lane instead of placing a sign.

For now, considering the people's ideas (and Issac's too), these are the possibilities I could think of that could be combined depending on the need:

I) Number of lanes:
- Two lanes: both lanes have traffic
- One lane: one lane is used, and the other is unused (where grass or white strips could be painted).

II) Directions:
- Two-direction
- One-direction

III) Overtaking:
- Allow
- Disallow

IV) Player vs. Citycars:
- Free traffic: player vehicles and citycars can use both lanes freely.
- Separate: player vehicles always drives on main lane, and citycars always drives on second lane. (i.e. main lane = right lane in U.S. and left lane in U.K)








I hope the former, but how could you set the direction of the road?
Player could. The direction could be set by the clicks:

1st click -----------> 2nd click
Therefore, traffic goes W -> E

2nd click <--------- 1st click
Therefore, traffic goes E -> W

Now, how would the player see the directions of the way after he's done?

1) The graphics, depending on the pakset theme, he can distinguish by colors and strips.

2) Likely "Show/Hide reserved blocks" and "Show/Hide station coverage", Simutrans could use visual cues (arrows and colored tiles) to show the player directions, type of road and ownership (if the road belongs to him, someone else, or public service).
« Last Edit: January 08, 2012, 03:49:48 AM by IgorEliezer »

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3651
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Proof of concept: one-way, two-lane avenues?
« Reply #20 on: December 12, 2011, 02:14:04 AM »
Simcity4 shows arrows that point the way. Seems like another option for display. :)

Good job on the post, Iggor; I hope this idea does take off. :D

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Proof of concept: one-way, two-lane avenues?
« Reply #21 on: December 12, 2011, 08:39:02 AM »
One issue is: how will the UI for building one-way roads work?

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotees (Inactive)
  • *
  • Posts: 1559
  • Languages: EN,ES,CAT
Re: Proof of concept: one-way, two-lane avenues?
« Reply #22 on: December 12, 2011, 09:21:38 AM »
Great job in your posts guys. Anyway I keep thinking two-lanes should be built only as a 4x4,4x6 or 4x6 when needed in a mandatory way, giving the chance to build one-way lanes be build manually when needed, will solve many usability problems, and those blocks can be used by cityrules easy, to avoid non-return lines. Just my thoughts, through. :) Applied to cityrules: they should be able to relocate citizens (build another building anywere else) and bulldoze the old building, to make room for new lanes.

EDIT: I'd take sim city 4 as a reference model too, was really easy to build in that game, and had lots of possibilities.
« Last Edit: December 12, 2011, 10:59:10 AM by Markohs »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9518
  • Languages: De,EN,JP
Re: Proof of concept: one-way, two-lane avenues?
« Reply #23 on: December 12, 2011, 08:27:30 PM »
OpenTTD has also one way roads. They use an arrow for them. I suggest to use a dedicated graphics and maybe add 128 to the system type for one way ...



I think, one way roads with separate lanes for player and citycars are most easy (but they defy the meaning of citycars ... ). Any other system would require a lot of addition to ist weg frei, which is already eating a lot of performance now. Also the sorting of vehicles need to be changed on such roads or again lot of clipping errors become obvious with trailer trucks and the like.

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1326
Re: Proof of concept: one-way, two-lane avenues?
« Reply #24 on: December 12, 2011, 09:15:26 PM »
Permanently displayed arrows on the road are rather ugly IMHO. I would rather have an arrow overlay displaying the ribis that can be toggled on/off as needed.

I'm still thinking highways instead of city avenues, atleast for a first crack. Is it cleaner to implement with system type, or just create a new waytype? A new waytype for highways, with access roads controlling the transition between waytypes seems better to me...

Separate player and citycar lanes turns citycars into eye candy only. They're supposed to be a nuisance when the player is badly serving the transport needs of the citizens. Pointless to implement this IMO, just turn citycars off instead.

ist_weg_frei isn't too bad CPU wise; Yet  ;) . Adding logic to handle city avenues would be a truly monumental undertaking. Having just recently overhauled the routine to better handle intersections, I think anyone attempting to expand this for multilane intersections will be in for a world of pain. Which leads me back to highways where there are no stops, no intersections, no crossings, ...

UI wise, freeform building is the only way. Other games that force placing of prefab 2x2 or larger blocks are always frustrating. The ribis could be set based on the order the tiles are constructed. i.e. Build tool for oneway roads would set the direction from first click to second (or along the drag direction). A separate tool to flip the directions of already build roads would be handy.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9518
  • Languages: De,EN,JP
Re: Proof of concept: one-way, two-lane avenues?
« Reply #25 on: December 12, 2011, 11:09:40 PM »
As long as there is no suitable ist_weg_frei, such construction is mood anyway. Imho, wether highway or not: The importance is free of crossings for that way type if ist_weg_frei is not to be touched. Maybe just a new way system type (16 or so) that forbids crossings with it and a second flag (system type 128) for one way.

Still I have troubles on how such a waytype would be allow to neglect any crossing checking and determines which lanes to use.

Offline isidoro

  • Devotee
  • *
  • Posts: 1129
Re: Proof of concept: one-way, two-lane avenues?
« Reply #26 on: December 12, 2011, 11:54:05 PM »
As you talk deeply about the topic I get more and more lost.  My comments may be nonsense.  If so, please ignore...

If planned as a new waytype, would it be possible to join several roads to form a 3-lane, 4-lane, etc. highway?

Would the problem of crossroads be simpler if only T crosses are allowed?  In fact, in highways, usually there are only T crosses at entrances (two in, one out) and exits (one in, two out).  Besides, T crosses force the use of roundabouts, don't they?

Regarding Igor's idea of citycars-only lanes, there's something like that in real life: bus only lanes in some big cities (but don't usually apply to transportation of goods).

The idea of my class 3 type (go to the right asap) was to allow for easy transition to normal roads.


Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9518
  • Languages: De,EN,JP
Re: Proof of concept: one-way, two-lane avenues?
« Reply #27 on: December 13, 2011, 12:03:23 AM »
Any crossing needs to be considered for ist_weg_frei, same as for determining whch lane to chose. Without extending it any bet is off. However, three way crossings may only affect vehicles on the right lane (resp. left lane) and my be easier to implement.

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3651
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Proof of concept: one-way, two-lane avenues?
« Reply #28 on: December 13, 2011, 02:20:13 AM »
I definitely think users should be able to place single rows of one-way tiles (like we have now with road placement). If there's some other building mode that uses 2x2, that's cool too - but when building roads, I may want to separate the two directional roads.

I can't do screenshots at the moment because I'm in a rehearsal at the theatre (long times between sound effects, though. hehe)... There are several bits for inspiration and discussion:

Roads are placed similarly to Simutrans, though slightly differently. Single-clicking lays a single tile of road; because of Simutrans's history, it's different, but this is minor and no reason to change. But of course you can click-drag to place road. Simutrans having the ability to click-move-click is also nice.

Avenues are places in 2x2 sections, as has been discussed here. This is alright - it's certainly quick to place the roads, and the two one-way sides are automatic. Dragging an avenue over a road expands it to an avenue, with tiles on each end that convert to the road. This would be nice to have.

One-way roads are placed like roads, and here's something to consider: The direction is determined by the direction of the drag - and can be reversed by dragging the other way. This seems handy to emulate. I personally like the arrows on one-way roads. Some don't. So I recommend an overlay, like electric lines - but that can be toggled on or off like the tile grid. Maybe shift-6 - ^ - the caret? hehe

One concern has been the behaviour of citycars - randomly driving, wanting to turn right, being stuck in the left lane. Well, I for one will pay the price of watching the vehicle cut across traffic if needed. It's a small price to pay for having two lanes of traffic in the same direction. And we still have a bug where sometimes trucks/busses will stack on a single tile just after a curve anyway, so... minor point. :) There are a couple of other visual bugs that are subtle - and this is not criticism of the programmers in the slightest. Just a fact, and my entire point is that it's fine imho. :)

Here's a question: A suggestion was made to try highways first; then worry about city avenues later. Would this be a good step? I'm all for it, if so. I know there would be pressure to get avenues working if highways were done - but this is always true. We always have more ideas, no matter where things go. :)


Offline mEGa

  • 2D painter
  • Devotees (Inactive)
  • *
  • Posts: 1041
  • Pak128 graphics
    • mEGa_Simutrans
  • Languages: FR, EN, ru
Re: Proof of concept: one-way, two-lane avenues?
« Reply #29 on: December 13, 2011, 11:09:08 AM »
I have a graphic question (Is it too early ?) :
how to make a realistic connecting between acces-ramp and motorway line ?
At present -e.g. with pak128- we can create a approximatively junction with several roads  but not very realistic (see joined picture).
Could we build up this kind of connecting (named "New" on picture)? How vehicules runs on this ?



Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4594
  • Languages: EN, DE, AT
Re: Proof of concept: one-way, two-lane avenues?
« Reply #30 on: December 13, 2011, 03:00:40 PM »
Imho, this discussion turned into some kind of christmas wish list.

Discussion about graphics, UI, etc, are quite useless, if there is no single line of code written.

As soon there is a working implementation of what Isidoro called class 2 or 3 (if it were only for straight lines of road), one can start discussion UI issues.

@Isidoro: prissi was talking about extending the current way system-types (flat, elevated, tram) to have more flags like one-way, no-crossings.

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3651
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Proof of concept: one-way, two-lane avenues?
« Reply #31 on: December 13, 2011, 03:58:19 PM »
Well, there probably has to be some sort of discussion about ideas and such; though of course there also have to be decisions made and code written before graphics painted. :)

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2898
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: Proof of concept: one-way, two-lane avenues?
« Reply #32 on: December 13, 2011, 05:11:52 PM »
I kept track of this discussion and think now I should give one idea. We could use layers, this way we can use less graphics and the game build the way. This gives the ability to have multiple waytypes with the same speed and texture. The idea will have a sub-menu, to work this way:
-You first choose the speed and texture
-Then choose what type it will be, one-way, double-lane, with or without overtaking, elevated or not, etc.


Explaining the image: (used 96.comic for fast image edit)
The 200Km/h road is chosen and the options are:
1- chosen as with overtaking. Other option will be no overtaking.
2- chosen as normal (right hand). Other options will be one way and left hand
3- chosen as normal road. Other options will be Right lane for player, Left lane for player and Both lanes for player.
4- chosen as both lanes. Other options will be no lane on right and no lane on left.
5- chosen as elevated. Other option will be normal (ground level).

An overlay with arrows will be the best solution. In video settings we could add the One-way arrows every N tiles. You could choose from 0 to 15, with 0 being none at all. In any option the arrows will show in crossings.

« Last Edit: December 13, 2011, 05:38:36 PM by An_dz »

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3651
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Proof of concept: one-way, two-lane avenues?
« Reply #33 on: December 13, 2011, 05:30:01 PM »
Slightly off-topic, but if submenus become a reality, it really could trim up the menus - have road, elevated, and bridge all in one place :)

Graphically, I recommend a split isometric icon, because you need to show the direction of the road in N/S and E/W directions...

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9518
  • Languages: De,EN,JP
Re: Proof of concept: one-way, two-lane avenues?
« Reply #34 on: December 13, 2011, 05:45:30 PM »
Sigh, this is getting to the extension request section again, as everybody just giving his wish and aparently nobody writing code for it ...

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2898
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: Proof of concept: one-way, two-lane avenues?
« Reply #35 on: December 13, 2011, 05:48:53 PM »
Graphically, I recommend a split isometric icon, because you need to show the direction of the road in N/S and E/W directions...
I don't think so. Because the one-way I thought on follow the direction the user is dragging, the right-hand and left-hand doesn't matter, always right or left.

Sigh, this is getting to the extension request section again, as everybody just giving his wish and aparently nobody writing code for it ...
I think we need to first set how it will work, or someone will start writing code that will become useless.
Anyway, it's really looking more as Extension Request.

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3651
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Proof of concept: one-way, two-lane avenues?
« Reply #36 on: December 13, 2011, 07:35:49 PM »
I don't want to be annoying, so I'm out of this conversation.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9518
  • Languages: De,EN,JP
Re: Proof of concept: one-way, two-lane avenues?
« Reply #37 on: December 13, 2011, 08:17:53 PM »
Its an extension request. This is especially for continue a wishlist. If this is settled, one might think about implementation again, imho. Do not be stopped by my comment, it was and is an extremely tiresome time this autumn by my real life.

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1326
Re: Proof of concept: one-way, two-lane avenues?
« Reply #38 on: December 13, 2011, 08:21:19 PM »
As long as there is no suitable ist_weg_frei, such construction is mood anyway. Imho, wether highway or not: The importance is free of crossings for that way type if ist_weg_frei is not to be touched. Maybe just a new way system type (16 or so) that forbids crossings with it and a second flag (system type 128) for one way.

Still I have troubles on how such a waytype would be allow to neglect any crossing checking and determines which lanes to use.
ist_weg_frei obviously needs to be touched. However, I was thinking to simply branch it leaving the existing logic alone, and adding completely new logic when the car is on the highway.

When you say crossings here, I presume you're referring to a road/road intersection as opposed to a road/something else crossing (crossing_t object) ?


If planned as a new waytype, would it be possible to join several roads to form a 3-lane, 4-lane, etc. highway?
I'm going to say no. Seems that would be another huge headache.
Depending on the scale of the vehicle graphics in the pak, 3 lanes in one tile are possible. So I would like to support that.


Would the problem of crossroads be simpler if only T crosses are allowed?  In fact, in highways, usually there are only T crosses at entrances (two in, one out) and exits (one in, two out).
This is what I was planing. 2 or 3 lane highways tiles that can only connect to the ends of themselves. Much like airport runways work now but allowing curves/hills. A separate 1 lane access road would be the only allowed connection onto the right (or left) side of the highway.


   Besides, T crosses force the use of roundabouts, don't they?
Don't follow this???


One concern has been the behaviour of citycars - randomly driving, wanting to turn right, being stuck in the left lane. Well, I for one will pay the price of watching the vehicle cut across traffic if needed. It's a small price to pay for having two lanes of traffic in the same direction.
Having just worked so hard to eliminate most cases of cars driving through each other, this I don't like!  :D


  And we still have a bug where sometimes trucks/busses will stack on a single tile just after a curve anyway, so... minor point.
Do you have an example of this? And, that doesn't involve waypoints on a curve? (or many many road/rail crossings in a row)


Here's a question: A suggestion was made to try highways first; then worry about city avenues later. Would this be a good step?
Well, that's where I'm headed. Highways are something that's been on my TODO list for a long time. It's slowly making it's way towards the top as I work my way through understanding the entire Simutrans codebase. If someone else would care to implement avenues instead...


I have a graphic question (Is it too early ?) :
<...>
Could we build up this kind of connecting (named "New" on picture)? How vehicules runs on this ?
Early for that detail IMO. It would be nice ultimately to smoothly change lanes, or follow such a sloped road; But for a first start jumping between lanes the way vehicles currently do when overtaking will do.


Imho, this discussion turned into some kind of christmas wish list.

Discussion about graphics, UI, etc, are quite useless, if there is no single line of code written.
Wishlists are good! Some discussion is always helpful in getting other peoples' opinions on how things should work.
And, there's more than a single line of code already.  ;)   Albeit still no where near enough/ready.

The vehicle movement logic is what I've played with already. I can relatively easily (hah!) take care of that.
The way builder / graphical end of things is where I'm still rather cloudy. I simply haven't done much with that part of the code yet...


I don't want to be annoying, so I'm out of this conversation.
Unless you're planning your future comments to be annoying, please stick around. Input is good.

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotees (Inactive)
  • *
  • Posts: 1559
  • Languages: EN,ES,CAT
Re: Proof of concept: one-way, two-lane avenues?
« Reply #39 on: December 13, 2011, 09:16:03 PM »
ok, why don't we make a draft of all of this? I can make one, accept suggestions/proposals/comments from the developers and reach to a decision of where do we want to go and will implement? If everybody agrees I'll elaborate the document from the comments so far. Or another person that wants to do it, I don't care. :)

We could use IgorElizer and An_dz posts as base for the document.
« Last Edit: December 13, 2011, 09:21:43 PM by Markohs »

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3651
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Proof of concept: one-way, two-lane avenues?
« Reply #40 on: December 13, 2011, 10:05:35 PM »
Having just worked so hard to eliminate most cases of cars driving through each other, this I don't like!  :D

Oh, I just meant it was mentioned previously as a reason not to work on this sort of thing, so I was hoping that wouldn't prevent work now.... I'm excited to hear that it's mostly solved already. :D

Quote
Do you have an example of this? And, that doesn't involve waypoints on a curve? (or many many road/rail crossings in a row)

I had it on a saved game - I'll find it later (not at home right now). It was a simple truck route between factories; It wasn't a 180 degree; I think it was just a 90 degree---anyway, I'll get the saved game later tonight.

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: Proof of concept: one-way, two-lane avenues?
« Reply #41 on: December 14, 2011, 12:43:31 AM »
O hi there! 8)

Now this turned into a discussion about the discussion, let me say something about it:

I don't know why the worry about forum members dishing out and commenting ideas in a topic publicly open. I haven't seen members demanding, but just showing their interest and ideas on the most wanted ever, almost a taboo, feature for Simutrans. And I couldn't expect another kind of reaction from Simutrans gamers.

As in any other public discussion, it's expected that something will derail or go beyond the boundaries. If something is too early for discussion, just say so; I believe our members will comprehend.

And the people who are interested in implementing the feature (most welcome), just pick up what is useful for now and leave (or just ignore if absurd) other stuff to be handled later on, and get along.

Me just saying.... YAY for the most welcome feature ever :D
« Last Edit: December 14, 2011, 04:44:41 AM by IgorEliezer »

Offline isidoro

  • Devotee
  • *
  • Posts: 1129
Re: Proof of concept: one-way, two-lane avenues?
« Reply #42 on: December 14, 2011, 01:22:52 AM »
@prissi: my first idea about this post was not an extension request exactly (something like: "I would like to see this in the game.  Please, code it").  It all came because I thought that this desirable new feature seemed to me quite simple to implement (based on my limited experience with the overtaking patch).  It was more like a "what do you people that usually work with the code think about this?  Am I missing something?"

@all: then, this all brainstorming came, which I think it is marvelous, and shows that people are really interested in a feature like this (and became sort of an extension request/wishlist)...  No problem, imho, much on the contrary.

The problem, as An_dz pointed out, is that one cannot start coding if we don't know what to code.  My proposal is to follow a more formal, computer scientish, way of doing things...  We are on the right path.  After the brainstorming, first, let the leaders of the project define what is wanted.  Second, plan several partial simple goals/steps aiming to the final solution.  Third, while advancing step by step, replan when necessary.

For me, a project like this is too much, specially without help, but if put it clearly maybe a partial step towards a known goal is feasible.

It would be like a new thread (development project) with a first post with requirements specification, milestones, and development...

Addendum: Igor was quicker than me typing and his post went first while writing mine.  If I accidentally touched a controversial topic, I'm sorry.  I'm not very lucky with this, I guess...  I'm not that old in the ST community...


Offline mEGa

  • 2D painter
  • Devotees (Inactive)
  • *
  • Posts: 1041
  • Pak128 graphics
    • mEGa_Simutrans
  • Languages: FR, EN, ru
Re: Proof of concept: one-way, two-lane avenues?
« Reply #43 on: December 14, 2011, 05:36:01 AM »

The problem, as An_dz pointed out, is that one cannot start coding if we don't know what to code.  My proposal is to follow a more formal, computer scientish, way of doing things...  We are on the right path.  After the brainstorming, first, let the leaders of the project define what is wanted.  Second, plan several partial simple goals/steps aiming to the final solution.  Third, while advancing step by step, replan when necessary.

For me, a project like this is too much, specially without help, but if put it clearly maybe a partial step towards a known goal is feasible.

It would be like a new thread (development project) with a first post with requirements specification, milestones, and development...

I'm completely agree with you. Imho, brainstoming is good and this feature could be a big step for game, but I understand that will be an hard work for developpers.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4594
  • Languages: EN, DE, AT
Re: Proof of concept: one-way, two-lane avenues?
« Reply #44 on: December 14, 2011, 06:25:54 AM »
I volunteer to take care of possibly arising clipping errors as I am familiar with that part of the code.

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3651
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Proof of concept: one-way, two-lane avenues?
« Reply #45 on: December 14, 2011, 06:38:55 AM »
I volunteer to be a cheerleader for it, since that's about all I'm useful for. hehehe

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Proof of concept: one-way, two-lane avenues?
« Reply #46 on: December 14, 2011, 08:24:30 AM »
I volunteer for road graphics in 128, when they'll be required :P

Offline isidoro

  • Devotee
  • *
  • Posts: 1129
Re: Proof of concept: one-way, two-lane avenues?
« Reply #47 on: December 14, 2011, 11:11:43 PM »
I volunteer to be a cheerleader for it, since that's about all I'm useful for. hehehe

Less is nothing...  ;)   I'd rather be a successful high-school wrestler than a dull coder, though...

I suspect that I should volunteer for something...  :P   Oh, dear!
Well, I volunteer to try to write a set of agreed milestones(1) and goal(s), to submit to the head developers for approval before time for coding is started...

__________
(1) In fact, I would call them yardstones, since this is not such a big project, isn't is it?

 

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3651
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Proof of concept: one-way, two-lane avenues?
« Reply #48 on: December 15, 2011, 01:06:59 AM »
By that measure, they should be meterstones. :)

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4594
  • Languages: EN, DE, AT
Re: Proof of concept: one-way, two-lane avenues?
« Reply #49 on: December 15, 2011, 06:18:42 AM »
(1) In fact, I would call them yardstones, since this is not such a big project, isn't is it?
It might not be a big project as the expected outcome is small compared to all the game's features, but I expect to be a big project in terms of implementation time needed.

Offline mEGa

  • 2D painter
  • Devotees (Inactive)
  • *
  • Posts: 1041
  • Pak128 graphics
    • mEGa_Simutrans
  • Languages: FR, EN, ru
Re: Proof of concept: one-way, two-lane avenues?
« Reply #50 on: December 15, 2011, 06:32:41 AM »
I'm volunteer to design road signs (an alternative to road arrows...?)  or/and help Fabio if necessary ;-)

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Proof of concept: one-way, two-lane avenues?
« Reply #51 on: December 15, 2011, 11:29:02 AM »
Please do not forget pak64!

(Eh, now I get to be the volunteer, right?)

Offline mEGa

  • 2D painter
  • Devotees (Inactive)
  • *
  • Posts: 1041
  • Pak128 graphics
    • mEGa_Simutrans
  • Languages: FR, EN, ru
Re: Proof of concept: one-way, two-lane avenues?
« Reply #52 on: December 15, 2011, 11:36:02 AM »
I can try to create for pak64, why not ;-)

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: Proof of concept: one-way, two-lane avenues?
« Reply #53 on: December 15, 2011, 03:46:00 PM »
It might not be a big project as the expected outcome is small compared to all the game's features, but I expect to be a big project in terms of implementation time needed.
Dwachs, he was just trying to seem modest. ;D

Offline isidoro

  • Devotee
  • *
  • Posts: 1129
Re: Proof of concept: one-way, two-lane avenues?
« Reply #54 on: December 15, 2011, 11:55:42 PM »
In fact, I wasn't.  8)

Now, more seriously. I've reread all posts, trying to make sense of all.  I plan now to take a look at the relevant code to further understand some comments by prissi, Dwachs and TurfIt and confront crude reality.  After that, I'll make a proposal.  By the way,

ok, why don't we make a draft of all of this? I can make one, accept suggestions/proposals/comments [...]

If you don't mind, give me some days to try to do it.  If I don't succeed, I pass the relay to you, to see if you are luckier...

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotees (Inactive)
  • *
  • Posts: 1559
  • Languages: EN,ES,CAT
Re: Proof of concept: one-way, two-lane avenues?
« Reply #55 on: December 16, 2011, 02:12:02 PM »
ok ;)

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
« Last Edit: January 08, 2012, 04:32:59 AM by IgorEliezer »

Offline rsdworker

  • *
  • Posts: 281
Re: Proof of concept: one-way, two-lane avenues?
« Reply #57 on: January 17, 2012, 11:06:20 PM »
sounds good idea so that's will be great and useful for one way and motorways