Auge's Basic Roads

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply
Auge
Route Supervisor
Route Supervisor
Posts: 444
Joined: 23 Oct 2006 02:07
Location: Berlin

Auge's Basic Roads

Post by Auge »

Hello

By studying the source code and taking graphics from RattRoads, CountryRoads, Unspooled and AuzRoads I started my own road set. Following roads are planned.

- a foot path for providing ways where a village can build houses but with no vehicles on it
- a precinct/pedestrian zone for towns, also with no vehicle traffic but for cities
- a dirt road (30km/h)
- a paved town road (45km/h)
- an asphalt town road (55km/h, available: 1965)
- a paved country road (60km/h)
- a concrete country road (75km/h, avalable: 1940)
- an asphalt country road (90km/h, available: 1970)
- a concrete highway (90km/h, available: 1930)
- an asphalt highway (120km/h, available: 1975)

The first few roads are snow aware (foot path, dirt road, all country roads). The two town roads should also be available with trolley wires (not done) and I plan to include tram tracks without and with overhead wires with the same speed limits and introduction dates as the town roads and additionally interurban tram tracks.
AB-Roads-Status-2021-01-01.png
(9.96 KiB) Not downloaded yet
In the current state I am far from done (so far no trolleys and trams, not all streets are snow aware and many graphics are placeholders as one can see in the screenshot). I will release the set under the GPL2 (because but not only because the sets I use as base are also GPL2-licensed). The code will be avaliable on Github (currently it is a private repository).
AB-Roads-Schnee-2021-01-01.png
AB-Roads-Schnee-2021-01-01.png (5.59 KiB) Viewed 886 times
I have and will have questions.

First for now: Is it possible to prevent roads getting sidewalks when a town grows? It is nice to get the sidewalks automatically for town roads but they looks ugly when under the dirt road or the slim foot path.

So far from me.

Tschö, Auge
User avatar
Andrew350
Director
Director
Posts: 639
Joined: 19 Dec 2011 07:54
Location: Washington State, USA
Contact:

Re: Auge's Basic Roads

Post by Andrew350 »

Auge wrote: 01 Jan 2021 22:40 First for now: Is it possible to prevent roads getting sidewalks when a town grows? It is nice to get the sidewalks automatically for town roads but they looks ugly when under the dirt road or the slim foot path.
OpenTTD still places the town roads from the base graphics set underneath the NRT roads; that's where the sidewalks are coming from. In order to get rid of them, you basically have two options:
  • You can use the "replace" block to override the base set graphics (sprites 1313-1331) with something of your choosing. This has the benefit of only having to be done once, but whether it's worth it depends on what your specific goals are for what town roads will look like for different roadtypes. For example, I do this in RattRoads to ensure a consistent sidewalk sprite independent of the base set used, so I don't need specific sprites for each roadtype.
  • You can provide full tile sprites via the "underlay" or "overlay" graphics callbacks to hide the base graphics under your NRT roads. This must be done on a per-roadtype basis, but accomplishes the same thing.
Either way, if you wish to show the natural ground underneath instead of sidewalk, the disadvantage is that you have to provide specific support for all climates, and possibly different base sets, depending on how detailed you want to get. It's not ideal, but that's the best we can do right now :)
Kruemelchen
Traffic Manager
Traffic Manager
Posts: 180
Joined: 18 Feb 2017 17:47

Re: Auge's Basic Roads

Post by Kruemelchen »

This set looks promising! I like the idea of footpaths! :)
Auge
Route Supervisor
Route Supervisor
Posts: 444
Joined: 23 Oct 2006 02:07
Location: Berlin

Re: Auge's Basic Roads

Post by Auge »

Andrew350 wrote: 02 Jan 2021 06:37
Auge wrote: 01 Jan 2021 22:40 First for now: Is it possible to prevent roads getting sidewalks when a town grows? It is nice to get the sidewalks automatically for town roads but they looks ugly when under the dirt road or the slim foot path.
OpenTTD still places the town roads from the base graphics set underneath the NRT roads; that's where the sidewalks are coming from.
So far, so known.
Andrew350 wrote: 02 Jan 2021 06:37 You can use the "replace" block to override the base set graphics (sprites 1313-1331) with something of your choosing. This has the benefit of only having to be done once, but whether it's worth it depends on what your specific goals are for what town roads will look like for different roadtypes. For example, I do this in RattRoads to ensure a consistent sidewalk sprite independent of the base set used, so I don't need specific sprites for each roadtype.
I found only the replacement for one-way-road-arrows and subarctic-street-trees (and something, I can't remember without seeing the code) but no code for sidewalk-replacements in your nml-source for RattRoads 1.0.2. I must find my own ancient code for the Comic-Roads replacements, where I did nothing else than replacing the base graphics.

Beside that I suspect, I can only disable the default streets in general but not per road type?
Andrew350 wrote: 02 Jan 2021 06:37 You can provide full tile sprites via the "underlay" or "overlay" graphics callbacks to hide the base graphics under your NRT roads. This must be done on a per-roadtype basis, but accomplishes the same thing.
That sounds promising but ...
Andrew350 wrote: 02 Jan 2021 06:37 Either way, if you wish to show the natural ground underneath instead of sidewalk, the disadvantage is that you have to provide specific support for all climates, and possibly different base sets, depending on how detailed you want to get.
... this point is valid for the second approach or for both of them?
Andrew350 wrote: 02 Jan 2021 06:37 It's not ideal, but that's the best we can do right now :)
It would be nice to have a bitmask flag to control this per roadtype (ROADTYPE_FLAG_NO_DEFAULT UNDERLAY or ..._NO_SIDEWALKS or something similar).

Anyway, thank you for your advice.

Tschö, Auge
User avatar
Andrew350
Director
Director
Posts: 639
Joined: 19 Dec 2011 07:54
Location: Washington State, USA
Contact:

Re: Auge's Basic Roads

Post by Andrew350 »

Auge wrote: 04 Jan 2021 14:37 found only the replacement for one-way-road-arrows and subarctic-street-trees (and something, I can't remember without seeing the code) but no code for sidewalk-replacements in your nml-source for RattRoads 1.0.2.
Ah, that bit is here:

Code: Select all

replace replace_road_city_universal (1313, "gfx/misc_sprites.png") { //replaces the base sprites to make sure city roads stay consistent across base sets
	template_roads_main_new(1, 1)
}
Auge wrote: 04 Jan 2021 14:37 Beside that I suspect, I can only disable the default streets in general but not per road type?
That is correct.
Auge wrote: 04 Jan 2021 14:37 ...this point is valid for the second approach or for both of them?
Both of them, unfortunately.
Auge wrote: 04 Jan 2021 14:37 It would be nice to have a bitmask flag to control this per roadtype (ROADTYPE_FLAG_NO_DEFAULT UNDERLAY or ..._NO_SIDEWALKS or something similar)
I agree :)
Timberwolf
Traffic Manager
Traffic Manager
Posts: 248
Joined: 22 May 2006 18:25
Location: London-ish.
Contact:

Re: Auge's Basic Roads

Post by Timberwolf »

It'd be nice to be able to toggle the town pavements and the depot underlays separately per roadtype, perhaps something like ROADTYPE_FLAG_NO_TOWN_PAVEMENTS and ROADTYPE_FLAG_NO_DEPOT_UNDERLAY.

(There are also bridge heads, but I'm not sure if those are useful to turn off as they vary according to bridge type)
User avatar
Gadg8eer
Traffic Manager
Traffic Manager
Posts: 157
Joined: 14 Dec 2019 14:22

Re: Auge's Basic Roads

Post by Gadg8eer »

Auge wrote: 01 Jan 2021 22:40 Hello

By studying the source code and taking graphics from RattRoads, CountryRoads, Unspooled and AuzRoads I started my own road set. Following roads are planned.

- a foot path for providing ways where a village can build houses but with no vehicles on it
- a precinct/pedestrian zone for towns, also with no vehicle traffic but for cities
- a dirt road (30km/h)
- a paved town road (45km/h)
- an asphalt town road (55km/h, available: 1965)
- a paved country road (60km/h)
- a concrete country road (75km/h, avalable: 1940)
- an asphalt country road (90km/h, available: 1970)
- a concrete highway (90km/h, available: 1930)
- an asphalt highway (120km/h, available: 1975)

The first few roads are snow aware (foot path, dirt road, all country roads). The two town roads should also be available with trolley wires (not done) and I plan to include tram tracks without and with overhead wires with the same speed limits and introduction dates as the town roads and additionally interurban tram tracks.

AB-Roads-Status-2021-01-01.png

In the current state I am far from done (so far no trolleys and trams, not all streets are snow aware and many graphics are placeholders as one can see in the screenshot). I will release the set under the GPL2 (because but not only because the sets I use as base are also GPL2-licensed). The code will be avaliable on Github (currently it is a private repository).

AB-Roads-Schnee-2021-01-01.png

I have and will have questions.

First for now: Is it possible to prevent roads getting sidewalks when a town grows? It is nice to get the sidewalks automatically for town roads but they looks ugly when under the dirt road or the slim foot path.

So far from me.

Tschö, Auge
You might find this to be useful. It's the source code to a "Roadtype Fixes" GRF I've already released on BaNaNaS. It replaces the default road graphics with grass and concrete.
Attachments
nrtfix_12a.7z
(181.73 KiB) Downloaded 11 times
I have Asperger's, please be easy on me about stuff. My apologies if I've been a problem for you in the past.
Auge
Route Supervisor
Route Supervisor
Posts: 444
Joined: 23 Oct 2006 02:07
Location: Berlin

Re: Auge's Basic Roads

Post by Auge »

Hello
Gadg8eer wrote: 05 Jan 2021 01:09
Auge wrote: 01 Jan 2021 22:40 Is it possible to prevent roads getting sidewalks when a town grows? It is nice to get the sidewalks automatically for town roads but they looks ugly when under the dirt road or the slim foot path.
You might find this to be useful. … It replaces the default road graphics with grass and concrete.
Yes, after the first sight into the code it is helpful. Thank you.

Tschö, Auge
Auge
Route Supervisor
Route Supervisor
Posts: 444
Joined: 23 Oct 2006 02:07
Location: Berlin

Re: Auge's Basic Roads

Post by Auge »

Hello

I am working on adding new and overhaul existing graphics for a few road types and fell into a trap while experimenting. I wanted to add graphic styles for european roads and north american roads with their white or yellow road markings. Nothing easier than that. Add the parameter to the NewGRF and use it to select the according sprite set.

Then I had the idea to define the road markings as the overlays to a single underlay spriteset (no need for more as this one then) and tried that on one road type. The road-marking-overlays would be compemented with optional snow sprites as a second, combined variant. And so it began. Everything worked as expected until it came to bridge surfaces. With the correct underlay the surface in itself was correct displayed but OpenTTD used the overlays for straight, rising and descending street tiles for the road markings on bridges. That way also the outside road markings of these tiles is visible.
Unbenannt, 1. Jan 1980.png
(35.78 KiB) Not downloaded yet
As one can see, the program combines on bridges the road surface sprites with their hardcoded road markings (with the doubled solid lines for the north american style) with the open worked line of the flat road sprites and the one-side open worked line of the road marking for rising street sprites and with the outer road markings of these sprites. Is it normal that OpenTTD uses the wrong overlays for bridges when they are provided as overlay (road markings in general and the complete bridge surface sprites)? Other road type graphics (taken from other sets) have their road markings hardcoded in the underlay and have no overlays for bridge sprites.
hway_concrete_northamerica_over.png
hway_concrete_northamerica_over.png (8.84 KiB) Viewed 308 times
Is it a blind alley to follow the idea to provide different road markings as overlays (it seems so)? It seems to be easier to generate the different underlays for the road styles with their matching, hardcoded road markings in one spriteset.

Oh and another question. Is it possible to detect the game setting for left- or right-hand-driving in the GRF respectively with NML?

Thank you in advance and tschö, Auge
Timberwolf
Traffic Manager
Traffic Manager
Posts: 248
Joined: 22 May 2006 18:25
Location: London-ish.
Contact:

Re: Auge's Basic Roads

Post by Timberwolf »

Auge wrote: 18 Jan 2021 12:55 Oh and another question. Is it possible to detect the game setting for left- or right-hand-driving in the GRF respectively with NML?
Yes - here is the relevant switch from Timberwolf's Roads:

Code: Select all

switch (FEAT_ROADTYPES, SELF, switch_driveside_town_underlay, traffic_side) {
    TRAFFIC_SIDE_RIGHT: rhs_town_underlay;
    town_underlay;
}
Hopefully that makes sense enough by itself, the relevant variable is traffic_side.
Auge
Route Supervisor
Route Supervisor
Posts: 444
Joined: 23 Oct 2006 02:07
Location: Berlin

Re: Auge's Basic Roads

Post by Auge »

Hello
Timberwolf wrote: 18 Jan 2021 14:02 here is the relevant switch from Timberwolf's Roads:

Code: Select all

switch (FEAT_ROADTYPES, SELF, switch_driveside_town_underlay, traffic_side) {
    TRAFFIC_SIDE_RIGHT: rhs_town_underlay;
    town_underlay;
}
Hopefully that makes sense enough by itself, the relevant variable is traffic_side.
Thank you. That's really simple and reacts instantaneously on the change of the game setting (as tested just now with your road set). :-)

Beside that, I get the feeling that my experiment with road markings as overlay was a fail. I will rework graphics and code. Additionally I get new ideas studying the code of your set (maybe i.e. time dependent sprites and speed limits).

Tschö, Auge
Auge
Route Supervisor
Route Supervisor
Posts: 444
Joined: 23 Oct 2006 02:07
Location: Berlin

Re: Auge's Basic Roads

Post by Auge »

Hello

With the help of Timberwolf's code example I was able to implement the left hand driving sprites into the first road type. It's not perfect but it's a starting point. Thank you, Timberwolf.

ab-roadset-lhd.png
ab-roadset-lhd.png (13.88 KiB) Viewed 164 times

Tschö, Auge
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 41 guests