Making road speed limits based on town zone (or lack thereof)

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
TransportFanMar
Engineer
Engineer
Posts: 9
Joined: 16 Dec 2021 12:02

Making road speed limits based on town zone (or lack thereof)

Post by TransportFanMar »

Currently, some NewGRFs such as U&RaTT have different road types with varying speed limits, including "urban" road types which have no benefit except realism (as they are slower than equivalent non-urban which also can have houses nearby), supported by NRT. It confuses me what the point of the urban roads is as even highways (which don't spawn houses) can have a "sidewalk".

Then I thought, what if town zone (or lack thereof for roads outside a town) rather than road type (or even both, with the lower taking precedence) was used to determine speed limits, say between 50km/h and 70km/h within cities and 100km/h or higher (or unlimited) outside cities? Would this be feasible to be part of the base game or with NewGRFs? I wonder if this is even possible.
Auge
Director
Director
Posts: 633
Joined: 23 Oct 2006 02:07
Location: Berlin

Re: Making road speed limits based on town zone (or lack thereof)

Post by Auge »

Hello
TransportFanMar wrote: 10 Jan 2022 06:08 Currently, some NewGRFs such as U&RaTT have different road types with varying speed limits, including "urban" road types which have no benefit except realism (as they are slower than equivalent non-urban which also can have houses nearby), supported by NRT. It confuses me what the point of the urban roads is as even highways (which don't spawn houses) can have a "sidewalk".
The sidewalk is (in the most sets) the default sidewalk from the main game. It's drawn (when drawn) under the road graphic and its drawing depends on the town zone (no sidewalk or sidewalk, with or without trees or lamps …). This leads to the situation, that the default sidewalks are drawn under every road type, even this makes no sense. Unfortunately NRT does not provide a way to regulate the sidewalks road type dependent.
TransportFanMar wrote: 10 Jan 2022 06:08 Then I thought, what if town zone (or lack thereof for roads outside a town) rather than road type (or even both, with the lower taking precedence) was used to determine speed limits, say between 50km/h and 70km/h within cities and 100km/h or higher (or unlimited) outside cities? Would this be feasible to be part of the base game or with NewGRFs? I wonder if this is even possible.
No, with the current game code this isn't possible (as far as I know). All towns are generated with the fastest available roads (depending on time of game start) that are allowed as town roads. Beside of that I wouldn't like this mechanism but that's my own, private opinion.

Tschö, Auge
RoyalExamination9410
Traffic Manager
Traffic Manager
Posts: 167
Joined: 14 Nov 2021 06:56
Location: Canada

Re: Making road speed limits based on town zone (or lack thereof)

Post by RoyalExamination9410 »

TransportFanMar wrote: 10 Jan 2022 06:08 Currently, some NewGRFs such as U&RaTT have different road types with varying speed limits, including "urban" road types which have no benefit except realism (as they are slower than equivalent non-urban which also can have houses nearby), supported by NRT. It confuses me what the point of the urban roads is as even highways (which don't spawn houses) can have a "sidewalk".

Then I thought, what if town zone (or lack thereof for roads outside a town) rather than road type (or even both, with the lower taking precedence) was used to determine speed limits, say between 50km/h and 70km/h within cities and 100km/h or higher (or unlimited) outside cities? Would this be feasible to be part of the base game or with NewGRFs? I wonder if this is even possible.
How do we tell what town zone is, you can't seem to see how far they go. Otherwise its a good idea, I manually put in 30 km/h roads in some towns as residential streets but as the towns grow they extend the roads with modern full speed road pieces, this doesn't look too realistic to me
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Making road speed limits based on town zone (or lack thereof)

Post by wallyweb »

Here is a simple little tool that I am working on.
93_TownZone.grf
(2.77 KiB) Downloaded 84 times
It is very much a work in progress so there is no documentation yet.
It is gpl v2 so do with it what you will.

It is object based and can be overbuilt without dynamite.
When placed within a town's limits it displays the zone of that tile.
Beyond a town's limits it displays a solid red tile.
The numbers will change as a town grows so you might have to press "Apply Changes" to see the results.
Another option to see the changes is to simply drag a mini window across the tiles.

At the moment only flat tiles are supported. Sloped tiles are in the development roadmap.
_dp_
Transport Coordinator
Transport Coordinator
Posts: 277
Joined: 18 Dec 2013 12:32

Re: Making road speed limits based on town zone (or lack thereof)

Post by _dp_ »

You can grab citymania client (https://citymania.org/downloads) if you want to see town zones, it has a zoning mode that shows them all nicely.
Screenshot from 2021-04-03 00-09-29.png
(493.58 KiB) Not downloaded yet
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Making road speed limits based on town zone (or lack thereof)

Post by wallyweb »

_dp_ wrote: 11 Jan 2022 12:26 You can grab citymania client (https://citymania.org/downloads) if you want to see town zones, it has a zoning mode that shows them all nicely.
Nice. :bow:
Do you rebase it with new OpenTTD releases?
_dp_
Transport Coordinator
Transport Coordinator
Posts: 277
Joined: 18 Dec 2013 12:32

Re: Making road speed limits based on town zone (or lack thereof)

Post by _dp_ »

wallyweb wrote: 11 Jan 2022 12:37 Do you rebase it with new OpenTTD releases?
Yes, all releases and even some pre-releases. You can see the full list of older versions at the bottom of that download page.
ufiby
Traffic Manager
Traffic Manager
Posts: 158
Joined: 18 Nov 2017 13:58

Re: Making road speed limits based on town zone (or lack thereof)

Post by ufiby »

It is impossible to determine the speed limits in an town zone. Thus, there is no such thing as variable speed in the current game code. The city road is drawn on top of the sidewalk, which is used by default in the base game. For a city road, it doesn't depend on the town zone, it's just for decoration and to taste. U&RaTT has "sequence" parameters that limit the speed of movement only in the city, which are not available to the player. Unfortunately, this is not enough. For me, the speed limit on every type of road is not impressive. Thus, any vehicles, including passenger cars, move the same way with a limited speed of the road type. Therefore, passenger cars cannot catch up with the truck. This game is a bit boring.
There is another idea. Vehicles have variable speeds and so on. It's a bit like reality. But this will require a lot of work with the compatibility of road types. For example, a bus travels on non-high-speed asphalt roads, gaining a maximum speed of 120 km/h, despite the fact that the types of roads have speed limits that are much lower than the speed of the bus. If the bus is traveling on a highway where there are no speed limits, the speed will increase faster than the maximum speed. This is closer to reality.

Image
Kruemelchen
Transport Coordinator
Transport Coordinator
Posts: 287
Joined: 18 Feb 2017 17:47

Re: Making road speed limits based on town zone (or lack thereof)

Post by Kruemelchen »

At least road vehicles can have adaptable max speed in that sense, as they can be made to go slower than the actual speed limit of the roadtype. So a truck can run at 70 kph on country roads, 90 kph on highways, or even only 40 kph on city roads, despite the roads may have higher speed limits. It is not difficult to code, but it is difficult to give support for every roadtype set out there.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 9 guests