Author Topic: In what method is road replacing written?  (Read 791 times)

Dwachs, R1dO and 2 Guests are viewing this topic.

Offline THLeaderH

In what method is road replacing written?
« on: July 16, 2017, 03:57:55 PM »
Roads in a city district are automatically replaced by cityroads under certain conditions. In what method is this replacement process written?

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2591
  • Total likes: 288
  • Helpful: 89
  • D'oh
    • by An_dz
  • Languages: PT, EN, (it, de)
Re: In what method is road replacing written?
« Reply #1 on: July 16, 2017, 04:53:04 PM »
If I'm not mistaken it's either in wegbauer or simcity. Perhaps in weg

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4633
  • Total likes: 168
  • Helpful: 108
  • Languages: EN, NO
Re: In what method is road replacing written?
« Reply #2 on: July 16, 2017, 05:07:10 PM »
As far as I can tell, city road construction takes place when buildings are built. Several classes are likely involved.

Online Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4206
  • Total likes: 161
  • Helpful: 148
  • Languages: EN, DE, AT
Re: In what method is road replacing written?
« Reply #3 on: July 16, 2017, 05:54:08 PM »
simcity.cc, stadt_t::build_road
Parsley, sage, rosemary, and maggikraut.

Offline DrSuperGood

Re: In what method is road replacing written?
« Reply #4 on: July 16, 2017, 07:22:07 PM »
Quote
Roads in a city district are automatically replaced by cityroads under certain conditions. In what method is this replacement process written?
They are not automatically replaced. What happens is that every time a city building is built or upgraded it replaces the surrounding road ways, that are not under a depot, with null owned (not public owned, null as in no player) roads of the current (the new) city road type. This upgrades existing city roads, as well as converts private roads to city roads.

It is very well possible that some roads may never upgrade because a city cannot ever build or upgrade anything around them.

Offline THLeaderH

Re: In what method is road replacing written?
« Reply #5 on: July 17, 2017, 02:46:02 AM »
Thank you for your advices, everyone 8)
I found this part of code in stadt_t::build_road(). It's simcity.cc::L3318~L3325
Code: [Select]
if (!bd->weg_erweitern(road_wt, connection_roads)) {
strasse_t* weg = new strasse_t();
// Hajo: city roads should not belong to any player => so we can ignore any construction costs ...
weg->set_desc(welt->get_city_road());
weg->set_gehweg(true);
bd->neuen_weg_bauen(weg, connection_roads, player_);
bd->calc_image(); // otherwise the
}
It seems that this part of code only builds new way. Where is replacement taken? Or does this code also do replacement?

Online Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4206
  • Total likes: 161
  • Helpful: 148
  • Languages: EN, DE, AT
Re: In what method is road replacing written?
« Reply #6 on: July 17, 2017, 05:58:19 AM »
replacement is done here: bool process_city_street(grund_t& gr, const way_desc_t* cr)
Parsley, sage, rosemary, and maggikraut.

Offline THLeaderH

Re: In what method is road replacing written?
« Reply #7 on: July 17, 2017, 06:01:37 AM »
I got it. Thank you.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8725
  • Total likes: 304
  • Helpful: 229
  • Languages: De,EN,JP
Re: In what method is road replacing written?
« Reply #8 on: July 18, 2017, 05:18:59 AM »
But with a wayobj making overtaking roads, you do not have to worry, as it will not be touched.

EDIT: I think a road with a wayobj should not be touched at all, and should have no automatic connection either. That would allow to put guardrails/noise fences etc. next to a road and have an inner city highway - a long requested feature.
« Last Edit: July 19, 2017, 12:44:21 PM by prissi »

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2591
  • Total likes: 288
  • Helpful: 89
  • D'oh
    • by An_dz
  • Languages: PT, EN, (it, de)
Re: In what method is road replacing written?
« Reply #9 on: July 19, 2017, 03:29:50 PM »
I believe THLeaderH will start using my patch that affects the roads itself rather than use wayobjs. I already posted my GitHub link so it can be integrated to the overtaking patch.

Offline THLeaderH

Re: In what method is road replacing written?
« Reply #10 on: July 20, 2017, 01:58:08 AM »
Quote
I believe THLeaderH will start using my patch that affects the roads itself rather than use wayobjs. I already posted my GitHub link so it can be integrated to the overtaking patch.
I decided to use a window like this rather than use a tool bar. I already finished implementation and it will be released with the next version, v11.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2591
  • Total likes: 288
  • Helpful: 89
  • D'oh
    • by An_dz
  • Languages: PT, EN, (it, de)
Re: In what method is road replacing written?
« Reply #11 on: July 20, 2017, 02:29:39 AM »
Ok, I'll focus on the graphics, I still need to create the global object.

Offline THLeaderH

Re: In what method is road replacing written?
« Reply #12 on: July 20, 2017, 06:47:56 AM »
Quote
EDIT: I think a road with a wayobj should not be touched at all, and should have no automatic connection either. That would allow to put guardrails/noise fences etc. next to a road and have an inner city highway - a long requested feature.
I think this should be implemented immediately.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4633
  • Total likes: 168
  • Helpful: 108
  • Languages: EN, NO
Re: In what method is road replacing written?
« Reply #13 on: July 20, 2017, 02:15:00 PM »
EDIT: I think a road with a wayobj should not be touched at all, and should have no automatic connection either. That would allow to put guardrails/noise fences etc. next to a road and have an inner city highway - a long requested feature.

I find that a bit too strict. Streets with electrification should be upgraded, and maybe even be allowed to grow new junctions, especially since regular players don't have the tools to upgrade city roads. They can upgrade, but then the sidewalk (and speed restriction) disappears. Maybe have some flags for this, like autoconnect in the other recent wayobj discussion?

Offline rapidliner

Re: In what method is road replacing written?
« Reply #14 on: Today at 03:44:07 AM »
A private view about the theme to which I say "Why do you become demand of change cityroad-ization algorithm raised?"

I think...maybe the algorithm of cityroad-ization on Simutrans is premised the urban development in the Europe, which "A city and a trunk road are blocked off clearly" and "Development of place which faces the main road is restricted severely". But the premise of urban development in Japan is difficult, so..."a city and a trunk road are NOT classified" and "a place which faces the trank road is also development object as a city".

The algorithm of cityroad-ization on Simutrans becomes fatal by Japanese-style development situation. We cannot be achieved "building of Japanese-style road traffic network" and "reproduction of Japanese road circumstance". Japanese Simutrans players has a lot of people who want to do Japanese-style trunk road play, and therefore "To change present city road-ization algorithm" is strong desired in Japan.

REF:Scenery of Japanese trunk road
https://upload.wikimedia.org/wikipedia/commons/a/a9/R407-shinjyukutyo.jpg
https://upload.wikimedia.org/wikipedia/commons/2/2a/Franchising%28Fujio_food_system%2Cccc%2CYELLOW_HAT_LLC%2CSeria%2CMcDonald%27s_Company_%28Japan%29%2C_Ltd.P8148155.JPG

Offline Vladki

Re: In what method is road replacing written?
« Reply #15 on: Today at 06:26:43 AM »
The question is, what is the allowed speed on such road in japan? Same as on other city roads?

The difference in Europe is, that if the road has higher speed limit than cca 50-60 km/h, then it is usually somehow (noise wall) separated from buildings, and has no sidewalk.

You can have multi-lane road inside the city, like on your picture, but it will have the same speed limit as any other road in the city.

Offline rapidliner

Re: In what method is road replacing written?
« Reply #16 on: Today at 08:02:07 AM »
In case of the road which isn't a expressway, the max speed on the Japanese law is 60km/h a trunk road and a city road. But, in case of a city road, which the max speed is often specified 30km/h-40km/h.

In case of a road like these pictures, the max speed can't be taken out by a traffic jam. Because passage vehicles and the vehicles which goes in and out of the roadside facilities are blended, and for a flow to stop at the stoplight. On the other hand in case of the trunk road where it has little traffic volume such as the night or the suburb, the speed limit is often exceeded(Geschwindigkeitsüberschreitung):-P
« Last Edit: Today at 08:19:09 AM by rapidliner »