NotRoadTypes

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

User avatar
andythenorth
Tycoon
Tycoon
Posts: 5009
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: NotRoadTypes

Post by andythenorth » 27 Dec 2016 18:57

wallyweb wrote:Is it intentional that a vehicle built in a road type's depot be restricted to travel only on that road type?
That's determined by the roadtypes in the grf.

In the Road Hog case, yes, I've enforced separation between road (ROAD) and heavy haul road (HAUL), because I prefer the game balance that way. :)

Other newgrf authors could take a different approach. ;)

There are however some limitations due to the way the railtype spec was designed - roadtypes and tramtypes follow broadly the same spec. Notably, the compatibility is determined by the railtype/roadtype/tramtype and not the vehicle, which has some side effects. George discovered them here for railtypes, and the limitation continues to apply as of Dec 2016: https://bugs.openttd.org/task/5006

Specifically the case of the supplies truck you mentioned, I want to fix. However it's not top priority. If you don't mind an ugly hack solution, you can build tram over both types of road with no limitation :D

Also FWIW, the tramtype labels would be wise to follow the railtype labels in many cases, as it avoids repeating much debate for similar end result. Road Hog provides RAIL for unelectrified tram, and ELRL for electrified tram. Tramtypes can effectively be treated as a class of light rail. https://newgrf-specs.tt-wiki.net/wiki/RailtypeLabels

User avatar
NekoMaster
Tycoon
Tycoon
Posts: 3945
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: NotRoadTypes

Post by NekoMaster » 27 Dec 2016 19:11

I too wish that we could at least have Road Vehicles on Heavy Haul Road but In real life, very rarely do Heavy Vehicles like Dump Trucks and Road Trains operate on normal roads open to the public. The same goes for normal traffic on Heavy Haul Roads, usually they're restricted to keep the roads clear for large heavy machinery. This is why road trains can basically run point to point quickly without stopping because there not really any traffic.

Still that might be a nice feature later on for a RATT GRF that would allow road vehicles on all road types (or allow Trucks and Busses on Heavy Roads)

I still hope that in the future we can have Road and Tram speed limits like in Simutrans. Might be nice if there could not only be different road speeds but different tram stuff, including dedicated light rail that maybe can cross roads but cannot be built ON roads, but will provide the best speed for high speed LRT trams or trains.

It also might be nice but this is pushing it, if just like how NuTracks provides a pseudo underground metro track, maybe RATT's could allow people to make graphics for an elevated tram way aka Elevated Rail (which might be able to connect with normal tram lines or "Underground" lines where the tram line doesn't appear on the road but vehicles would become a shadow to show they're "underground"


Anyways its a lot of hopeful wishing but at least Road and Tram Types stuff is sorta getting done.

I can't wait to see what the future has in store.

EDIT : Would it be possible for a Road Type GRF to change the graphic for the road sprite or one-way arrows for each road type?

For example, maybe have something like 120km\h Highway, which by default the Two-way highway sprite would look like for a USA style set a Double yellow line in the middle and white shoulder lines on the sides. But When converted to One-Way, insted of a double yellow line in the middle, it'll be a single solid yellow line on the left side (in the case of a RHD country like Canada or USA) and you'd have a dashed white line in the middle and a solid white line on the right hand side. This way people can make believable Dedicated highways (albit, 4 lane highways)
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!

User avatar
wallyweb
Tycoon
Tycoon
Posts: 5565
Joined: 27 Nov 2004 15:05
Location: Canada

Re: NotRoadTypes

Post by wallyweb » 27 Dec 2016 19:32

andythenorth wrote:Other newgrf authors could take a different approach. ;)
:bow:
There are however some limitations due to the way the railtype spec was designed - roadtypes and tramtypes follow broadly the same spec. Notably, the compatibility is determined by the railtype/roadtype/tramtype and not the vehicle, which has some side effects. George discovered them here for railtypes, and the limitation continues to apply as of Dec 2016: https://bugs.openttd.org/task/5006
Now might be an opportunty to fix this before it gets buried in that inferno called bug list. :twisted:
Specifically the case of the supplies truck you mentioned, I want to fix. However it's not top priority. If you don't mind an ugly hack solution, you can build tram over both types of road with no limitation :D
DISASTER: 3000 passengers and 1000 tourists condemned to eternity at the bottom of a coal mine, :P
Also FWIW, the tramtype labels would be wise to follow the railtype labels in many cases, as it avoids repeating much debate for similar end result. Road Hog provides RAIL for unelectrified tram, and ELRL for electrified tram. Tramtypes can effectively be treated as a class of light rail. https://newgrf-specs.tt-wiki.net/wiki/RailtypeLabels
:bow:

User avatar
wallyweb
Tycoon
Tycoon
Posts: 5565
Joined: 27 Nov 2004 15:05
Location: Canada

Re: NotRoadTypes

Post by wallyweb » 27 Dec 2016 20:05

Double post for a good cause ...
NekoMaster wrote:The same goes for normal traffic on Heavy Haul Roads, usually they're restricted to keep the roads clear for large heavy machinery.
Ram; F150, Silverado; ... :wink:
andythenorth wrote:Specifically the case of the supplies truck you mentioned, I want to fix.
This might work:
How does your code treat the default roads? The ones that towns build?
How about vehicles built in the default depot can go anywhere while those built in road type depots are restricted?

User avatar
NekoMaster
Tycoon
Tycoon
Posts: 3945
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: NotRoadTypes

Post by NekoMaster » 27 Dec 2016 20:10

BTW, If speed limits can be implemented, heres what I thought up for road types and speed limits.

I could try and make quick and dirty sprites but it'd be best if someone more capable with a greater attention span and motivation made them. Plus if I make road sprites, they'll probably be North American style.

Then theres also the possibility of generation graphics, you know, pre 1950 and post 1950 sprites to reflect advancements in technology

Code: Select all

Gravel Road	  30 Km\h (Pre 1950 : Gravel // Post 1950 : Gravel or Tarmac)
Street		    40 Km\h (Pre 1950 : Concrete Slabs or Cobble Stone // Post 1950 : Light Grey Asphalt/Poured Concrete)
Road		      60 Km\h (Pre 1950 : Red or Stone Brick // Post 1950 : Dark Asphalt)
Minor Highway	80 Km\h (Pre 1950 : Concrete slabs with white lines // Post 1950 : Light Grey Asphalt with Double Yellow Lines)
Major Highway	120 Km\h (Pre 1950 : Concrete Slabs with white lines // Post 1950 : Dark Asphalt with Double Yellow lines for 2-way, single yellow line on left hand side and dashed white line in the middle for one way)
Autobahn	     300 Km\h (Pre 1950 and Post 1950 : what ever they used back then and now for t he German Autobahn)
Speed Way	    Unlimited (65536 Km\h) (Always made of Dark Asphalt and perhaps red and white bits on the sides like a race tracks curbs)
* Speed way could be used for futuristic (hover) vehicles and race vehicles

Unpowered Tram Line	   160 Km\h
Electrified Tram Line	 160 Km\h

Light Rail Metro Line	 160 Km\h (Looks more like Railway tracks, cannot run on road but can cross)
Underground Metro Line	160 Km\h (Perhaps little posts or signs along the road and vehicles would have to be coded to disappear/become shadows underground)
Elevated Metro Line	   160 Km\h (Can be built along roads but as far as I know tram lines prevent one way roads, so you'll have to build roads on both sides for that
								 			 New York Center of the Large Road/Avenue EL Rail Look, plus the ground should be concrete or asphalt under the rails)
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!

User avatar
kamnet
Moderator
Moderator
Posts: 6860
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: NotRoadTypes

Post by kamnet » 27 Dec 2016 20:34

Do we have any outline or specs yet on what types of roads and tram lines will be included? Are we even at that point of discussion yet?

User avatar
NekoMaster
Tycoon
Tycoon
Posts: 3945
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: NotRoadTypes

Post by NekoMaster » 27 Dec 2016 20:39

kamnet wrote:Do we have any outline or specs yet on what types of roads and tram lines will be included? Are we even at that point of discussion yet?
I hope that like Nutracks, RATT's will allow for multiple road/tram types provided by a GRF
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!

User avatar
andythenorth
Tycoon
Tycoon
Posts: 5009
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: NotRoadTypes

Post by andythenorth » 27 Dec 2016 20:57

kamnet wrote:Do we have any outline or specs yet on what types of roads and tram lines will be included?
One roadtype per tile, one tramtype per tile. 16 or so roadtypes, 16 or so tramtypes. The specs are principally same as railtypes, except in a few cases.

"Someone" will need to update the newgrf wiki (both base/nfo and nml sections). :D I can't do it because I'm locked out of the newgrf wiki (why, who knows?). Frosch and Wolf have more than enough to do on actual openttd code.

It's probably fine to start with a copy of the railtypes pages and work through the differences / changes. A diff of the nml fork against nml trunk (attached) would give a guide to most of the supported properties (nml fork is nearly complete, but may miss a few things, including callbacks). https://github.com/andythenorth/nml-and ... tRoadTypes

I'm in irc most days in the holidays if anyone wanted to take the newgrf docs on.

Right now, the other most useful thing is good bug reports, for both game, and scenario editor. Already testers have found a few things we hadn't seen. ;)
Attachments
nml-notroadtypes.diff
(32.78 KiB) Downloaded 37 times

User avatar
kamnet
Moderator
Moderator
Posts: 6860
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: NotRoadTypes

Post by kamnet » 27 Dec 2016 21:23

Wow, 16 road AND 16 tram? :shock:

I think I'll start a new discussion about that, I don't want it to clog up this forum.
Last edited by kamnet on 27 Dec 2016 22:46, edited 1 time in total.


User avatar
wallyweb
Tycoon
Tycoon
Posts: 5565
Joined: 27 Nov 2004 15:05
Location: Canada

Re: NotRoadTypes

Post by wallyweb » 28 Dec 2016 06:24

kamnet wrote:Do we have any outline or specs yet on what types of roads and tram lines will be included? Are we even at that point of discussion yet?
Hopeully the specifications will be flexible enough so that set authors can determine any road type specific to their needs.
andythenorth wrote:"Someone" will need to update the newgrf wiki (both base/nfo and nml sections). :D I can't do it because I'm locked out of the newgrf wiki (why, who knows?). Frosch and Wolf have more than enough to do on actual openttd code.
Can't really write the spec until the developers have done their thing, at which point they would be the best ones to commit the spec.

User avatar
andythenorth
Tycoon
Tycoon
Posts: 5009
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: NotRoadTypes

Post by andythenorth » 28 Dec 2016 08:23

wallyweb wrote:Can't really write the spec until the developers have done their thing
Nah, the spec is near-complete as far as features go. :)

If it helps there are effectively two specs:

1. the newgrf interface (props, vars, cbs, spritegroups), which is mostly complete, and mostly implemented. Items remaining to decide include callbacks and some of the UI sprites. This needs documenting for newgrf (nfo and nml), at least as a draft.

2. the implementation in OpenTTD, including all the issues like behaviour of stuck vehicles, overbuilding, error messages, NoAI and NoGo (gamescript) interfaces. This is mostly complete and mostly implemented, but there will be bugs and edge cases found by testing.

There's no single doc for either right now, because a lot of the discussion was on irc. There is an original spec doc I wrote, but it's outdated and not useful for public consumption. ;)

User avatar
NekoMaster
Tycoon
Tycoon
Posts: 3945
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: NotRoadTypes

Post by NekoMaster » 28 Dec 2016 08:46

I'm sorry I keep spamming this question, but is there support for Speed Limits with RATT's? Honestly that's the only thing I really want out of Road and Tram Types, is multiple different roads with different speed limits
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!

User avatar
andythenorth
Tycoon
Tycoon
Posts: 5009
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: NotRoadTypes

Post by andythenorth » 28 Dec 2016 09:17

NekoMaster wrote:is there support for Speed Limits with RATT's?
Yes. It's not in the Road Hog example, but it's tested and working.

Here's a paste of the current properties from the nml compiler (roadtypes are same as tram).

Code: Select all

    'label'                    : {'size': 4, 'num': 0x08, 'string_literal': 4},
    'toolbar_caption'          : {'size': 2, 'num': 0x09, 'string': 0xDC},
    'menu_text'                : {'size': 2, 'num': 0x0A, 'string': 0xDC},
    'build_window_caption'     : {'size': 2, 'num': 0x0B, 'string': 0xDC},
    'autoreplace_text'         : {'size': 2, 'num': 0x0C, 'string': 0xDC},
    'new_engine_text'          : {'size': 2, 'num': 0x0D, 'string': 0xDC},
    'powered_tramtype_list'    : {'custom_function': lambda x: tramtype_list(x, 0x0F)},
    'tramtype_flags'           : {'size': 1, 'num': 0x10},
     # 'curve_speed_multiplier'   : {'size': 1, 'num': 0x11}, # not implemented, will cause an OpenTTD assert
    'construction_cost'        : {'size': 2, 'num': 0x13},
    'speed_limit'              : {'size': 2, 'num': 0x14, 'unit_type': 'speed', 'unit_conversion': (5000, 1397)},
    'map_colour'               : {'size': 1, 'num': 0x16},
    'introduction_date'        : {'size': 4, 'num': 0x17},
    'requires_tramtype_list'   : {'custom_function': lambda x: tramtype_list(x, 0x18)},
    'introduces_tramtype_list' : {'custom_function': lambda x: tramtype_list(x, 0x19)},
    'sort_order'               : {'size': 1, 'num': 0x1A},
    'name'                     : {'size': 2, 'num': 0x1B, 'string': 0xDC},
    'maintenance_cost'         : {'size': 2, 'num': 0x1C},
    'alternative_tramtype_list': {'custom_function': lambda x: tramtype_list(x, 0x1D)},
Similarity to railtypes is easy to see https://newgrf-specs.tt-wiki.net/wiki/NML:Railtypes

And the current callbacks (all of them handle graphics).

Code: Select all

    'gui'             : {'type': 'cargo', 'num': 0x00},
    'track_overlay'   : {'type': 'cargo', 'num': 0x01},
    'underlay'        : {'type': 'cargo', 'num': 0x02},
    'catenary_front'  : {'type': 'cargo', 'num': 0x04},
    'catenary_back'   : {'type': 'cargo', 'num': 0x05},
    'bridge_surfaces' : {'type': 'cargo', 'num': 0x06},
    'depots'          : {'type': 'cargo', 'num': 0x08},
Last edited by andythenorth on 28 Dec 2016 15:59, edited 1 time in total.

User avatar
wallyweb
Tycoon
Tycoon
Posts: 5565
Joined: 27 Nov 2004 15:05
Location: Canada

Re: NotRoadTypes

Post by wallyweb » 28 Dec 2016 11:59

andythenorth wrote:
wallyweb wrote:Can't really write the spec until the developers have done their thing
Nah, the spec is near-complete as far as features go. :)
...
...
Ok ... Then the devs have done their thing?

The NewGRF Specification is the defining document and should be done first.
NML and m4nfo are upper level languages that are built on top of the Specs.
The NewGrf Specs should be simple enough to do:
Enter the Railtypes fields in edit mode.
Highlight and copy everything
Create a new set of fields for Roadtypes
Paste in the Railtype Specs and save. - This way all wiki formatting will be imported
Edit to replace "Railtype" with "Roadtype"
Edit to replace Railtype dynamic links with Roadtype dynamic links
Edit to delete non-applicable Railtype references
Edit to add in new Roadtype references
Run a spelchecar
Save
Pray that you did not miss anything
Hand off to the NML and m4nfo maintainers so that they can do their thing.

I'd take this on except that I have at least five (5) other projects on the go and it would be mid 2017 before I could get to it. :P

User avatar
ISA
Tycoon
Tycoon
Posts: 3378
Joined: 17 Oct 2005 20:56
Location: Estonia

Re: NotRoadTypes

Post by ISA » 28 Dec 2016 17:39

wallyweb wrote:I'd take this on except that I have at least five (5) other projects on the go and it would be mid 2017 before I could get to it. :P
[OT] what could they be?[/OT]

Still amaze me what can be done if some fellows pull their sleevesup and get things rolling.

User avatar
wallyweb
Tycoon
Tycoon
Posts: 5565
Joined: 27 Nov 2004 15:05
Location: Canada

Re: NotRoadTypes

Post by wallyweb » 28 Dec 2016 18:12

ISA wrote:
wallyweb wrote:I'd take this on except that I have at least five (5) other projects on the go and it would be mid 2017 before I could get to it. :P
[OT] what could they be?[/OT]
Mostly bridges but some other stuff as well.

User avatar
ISA
Tycoon
Tycoon
Posts: 3378
Joined: 17 Oct 2005 20:56
Location: Estonia

Re: NotRoadTypes

Post by ISA » 28 Dec 2016 18:30

wallyweb wrote:
ISA wrote:
wallyweb wrote:I'd take this on except that I have at least five (5) other projects on the go and it would be mid 2017 before I could get to it. :P
[OT] what could they be?[/OT]
Mostly bridges but some other stuff as well.
Okey! Just missing a lot new/fresh/updated/well oiled Canadian Set 8)

Nvm... wrong place. Lets get back to topic

User avatar
supermop
Tycoon
Tycoon
Posts: 1046
Joined: 21 Feb 2010 00:15
Location: Fitzroy North - 96

Re: NotRoadTypes

Post by supermop » 29 Dec 2016 19:10

Having fun making a little mineral port with steam trams and heavy mining trucks:
Chafingbourne Bridge Transport, 1949-06-30.png
Chafingbourne Bridge Transport, 1949-06-30.png (90.29 KiB) Viewed 1711 times
Coal truck looks like it's sampling its own merchandise...

Auge
Route Supervisor
Route Supervisor
Posts: 386
Joined: 23 Oct 2006 02:07
Location: Berlin

Re: NotRoadTypes

Post by Auge » 30 Dec 2016 10:05

Hello

I have a question about the features too. Can road types define that houses can't be built beside these roads?

Tschö, Auge

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 7 guests