New Railtype Label Scheme

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1646
Joined: 30 Mar 2005 09:43

Re: New Railtype Label Scheme

Post by peter1138 »

It's a Wiki, can you not add it yourself?
He's like, some kind of OpenTTD developer.

User avatar
Erato
Route Supervisor
Route Supervisor
Posts: 478
Joined: 25 May 2015 09:09
Location: The Netherlands

Re: New Railtype Label Scheme

Post by Erato »

peter1138 wrote:It's a Wiki, can you not add it yourself?
You need to make an account to edit but account creation for the tt-wiki had been completely disabled.
No pics no clicks. Seriously. Also stop using Modern Maglev Trains. Use RIMS instead.
ImageImageImageImageImageImage

McZapkie
Tycoon
Tycoon
Posts: 1182
Joined: 18 Jan 2014 18:10

Re: New Railtype Label Scheme

Post by McZapkie »

I created grf with 600mm narrow gauge stock and appropriate tracks (NG60 narrow gauge and NG6R dual gauge), but after reading this thread, I'm afraid, that my names didn't comply with railtype naming scheme.
Is it a issue, or I can leave it as it is?
My experimental openTTD server: 149.156.194.203:3979 non-standard client, now testing: JGRPP http://tiny.pl/ggnch
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, preindustrial houses, wired, ECS industry extension, V4 CEE train set.
Addicted to freeciv longturn.

User avatar
Erato
Route Supervisor
Route Supervisor
Posts: 478
Joined: 25 May 2015 09:09
Location: The Netherlands

Re: New Railtype Label Scheme

Post by Erato »

McZapkie wrote:I created grf with 600mm narrow gauge stock and appropriate tracks (NG60 narrow gauge and NG6R dual gauge), but after reading this thread, I'm afraid, that my names didn't comply with railtype naming scheme.
Is it a issue, or I can leave it as it is?
It probably isn't an issue because 600mm is quite obscure. Not many people will be developing for that gauge. The biggest problem is probably that they're not on this list, so if people eventually do decide to make 600mm gauge trains they can make it compatible with your set.
No pics no clicks. Seriously. Also stop using Modern Maglev Trains. Use RIMS instead.
ImageImageImageImageImageImage

McZapkie
Tycoon
Tycoon
Posts: 1182
Joined: 18 Jan 2014 18:10

Re: New Railtype Label Scheme

Post by McZapkie »

Well, these 600mm track are relatively cheap in comparison with "regular" narrow gauge from nutrack or Japan set, thus different name is justified to keep them separated.

Another question:
I want to provide different electric traction catenary, how I should name tracks for 3kV DC, 16kV AC and 25 kV AC?
My experimental openTTD server: 149.156.194.203:3979 non-standard client, now testing: JGRPP http://tiny.pl/ggnch
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, preindustrial houses, wired, ECS industry extension, V4 CEE train set.
Addicted to freeciv longturn.

User avatar
Erato
Route Supervisor
Route Supervisor
Posts: 478
Joined: 25 May 2015 09:09
Location: The Netherlands

Re: New Railtype Label Scheme

Post by Erato »

McZapkie wrote:Well, these 600mm track are relatively cheap in comparison with "regular" narrow gauge from nutrack or Japan set, thus different name is justified to keep them separated.

Another question:
I want to provide different electric traction catenary, how I should name tracks for 3kV DC, 16kV AC and 25 kV AC?
https://newgrf-specs.tt-wiki.net/wiki/S ... .2A.2AX.5D
At the bottom here it says:
XXXA 25kV AC
XXXa 15kV AC, while not exactly 16kV AC, it's approximately the same
XXXD Generic DC / 3kV DC

Hope this helped.
No pics no clicks. Seriously. Also stop using Modern Maglev Trains. Use RIMS instead.
ImageImageImageImageImageImage

Eddi
Tycoon
Tycoon
Posts: 7479
Joined: 17 Jan 2007 00:14

Re: New Railtype Label Scheme

Post by Eddi »

McZapkie wrote:Well, these 600mm track are relatively cheap in comparison with "regular" narrow gauge from nutrack or Japan set, thus different name is justified to keep them separated.
Well, the idea of the unified railtype scheme was to allow "compehensive" train and track sets to have a common interface, so you can better mix and match them, instead of vendor-locking "X's train sets only go with X's trackset, and are incompatible with Y's trackset"

but for niche systems like these, you get less benefit from trying to fit it into the scheme. however, i would also advise you to put the vehicles for this kind of niche track into a separate train set, and not mix it with your regular gauge train set
You might not exactly be interested in Ferion, but if you are, have fun :)

User avatar
George
Tycoon
Tycoon
Posts: 4327
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: SPb, Russia.
Contact:

Re: New Railtype Label Scheme

Post by George »

Hello.

I'm trying to split xUSSR set into train set and rail set and it seams I have trouble in understanding
https://newgrf-specs.tt-wiki.net/wiki/S ... ype_Scheme

I can't understand the reason to remove original cargo label, while I can specify all the possible alternatives in the alternative_railtype_list ? What am I missing?

Also I can't understand, what is the correct list for alternatives?

I've attached the grf and the NML file, could you please have a look and tell, what should I fix (if required)?

Here goes Electrified rails AC 15kV for the example

Code: Select all

// Electrified rails AC 15kV
item (FEAT_RAILTYPES, er15ac2) {
  property {
    label: "ERa2";
    introduction_date: date(1952, 1, 1);
    name: string(STR_NAME_ER15AC2);
    toolbar_caption: string(STR_ER15AC2_TOOLBAR);
    menu_text: string(STR_ER15AC2_MENU);
    build_window_caption: string(STR_ER15AC1_BUILD_CAPTION);
    autoreplace_text: string(STR_ER15AC1_AUTOREPLACE);
    new_engine_text: string(STR_ER15AC1_NEW_ENGINE);
    compatible_railtype_list: [all_broad_rails()];
    powered_railtype_list: [all_15AC_broad_rails()];
    railtype_flags: bitmask(RAILTYPE_FLAG_CATENARY);
    curve_speed_multiplier: 1;
    station_graphics: RAILTYPE_STATION_NORMAL;
    construction_cost: 230;
    maintenance_cost: 7;
    speed_limit: 87.5 mph;                      //140 km/h;
    acceleration_model: ACC_MODEL_RAIL;
    map_colour: map_color_15ac + 4;
    sort_order: 0x19;
    alternative_railtype_list: ["ELRL", "BDAa", "SDAa", "BDAA", "SDAA",
                                        "BDBa", "SDBa", "BDBA", "SDBA",
                                        "BDCa", "SDCa", "BDCA", "SDCA",
                                        "BDDa", "SDDa", "BDDA", "SDDA",
                                        "BDEa", "SDEa", "BDEA", "SDEA", "RAIL"];
  }
  graphics {
    gui: rail2_gui;
    track_overlay: get_rail2_track_overlay;
    underlay: get_rail2_underlay;
    tunnels: get_rail2_tunnels;
    bridge_surfaces: get_rail2_bridge_surfaces;
    level_crossings: get_rail2_level_crossings;
    fences: fences_none;
    depots: rail1_depots;
    catenary_wire: er15ac_catenary_wire;
    catenary_pylons: er15ac_catenary_pylons;
  }
}
Here viewtopic.php?p=1235007#p1235007 I've wrote down the intentions
Attachments
railtrack.pnml
(45.3 KiB) Downloaded 27 times
Last edited by George on 13 Aug 2020 18:59, edited 1 time in total.
Image Image Image Image

Transportman
Tycoon
Tycoon
Posts: 2743
Joined: 22 Feb 2011 18:34

Re: New Railtype Label Scheme

Post by Transportman »

It is not possible to delete the default tracktypes (RAIL, ELRL, MONO and MGLV), but you can override other properties of it. For example, in the Dutch Trackset I override ELRL to be some generic slow yard-track, but trains that are defined to be for ELRL can run on all tracks in the set as it defines both the 1500VDC and HSL tracks as compatible and powered.

Basically, the alternative_railtype_list is mainly used for other train sets. It specifies the list of labels which also would apply to your track if not otherwise provided. If I take the Dutch Trackset and Dutch Trainset, I have the 1500VDC which has as main label SADD, but as alternatives "SAAD","SABD","SACD","SADD","SAED". In the Duch Trainset, trains that can only run on 1500VDC tracks use tracktype DC_B, which is defined in the railtypetable as [SABd, SABD, SABE, ELRL]. As you can see, SADD is not in the list, but SABD is in the railtypetable and is an alternative for my SADD-track and is thus used as such. Would no track set be loaded (or not one with the matching labels) the Dutch Trainset falls back to use ELRL as tracktype for all trains (except metros).

I hope this helps a bit.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML

User avatar
George
Tycoon
Tycoon
Posts: 4327
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: SPb, Russia.
Contact:

Re: New Railtype Label Scheme

Post by George »

Transportman wrote:
12 Aug 2020 16:19
It is not possible to delete the default tracktypes (RAIL, ELRL, MONO and MGLV), but you can override other properties of it. For example, in the Dutch Trackset I override ELRL to be some generic slow yard-track, but trains that are defined to be for ELRL can run on all tracks in the set as it defines both the 1500VDC and HSL tracks as compatible and powered.
Basically, the alternative_railtype_list is mainly used for other train sets. It specifies the list of labels which also would apply to your track if not otherwise provided. If I take the Dutch Trackset and Dutch Trainset, I have the 1500VDC which has as main label SADD, but as alternatives "SAAD","SABD","SACD","SADD","SAED". In the Duch Trainset, trains that can only run on 1500VDC tracks use tracktype DC_B, which is defined in the railtypetable as [SABd, SABD, SABE, ELRL]. As you can see, SADD is not in the list, but SABD is in the railtypetable and is an alternative for my SADD-track and is thus used as such. Would no track set be loaded (or not one with the matching labels) the Dutch Trainset falls back to use ELRL as tracktype for all trains (except metros).
Sorry, still confused, let's try to have a closer look

1) do you mean, that alternative_railtype_list should be defined for TRAIN SET only? If so, how can I specify the following behavior by default? I should specify them as normal guage?
George wrote:
07 Aug 2020 21:39
  • by default they act as 1435 (standard) and 1520 (broad) rails at the same time
2) can RAIL, ELRL, MONO and MGLV be hidden by setting railtype_flags to hidden?
3) Where **X* axle load class should be used?
4) The set provides ***D for 3kV and ***d for 1.5kV. How to make dutch trains understand, that they should use ***d rails and not ***D rails?
5) Where should I put old names (RLA2 ect.)? In the rails set or in the train set?
6) powered_railtype_list should be specified in the train or rail set?
let we figure out the props for rail set first

For example, what should I specify instead for a 15kV with speed limit D?
item (FEAT_RAILTYPES, er15ac2) {
property {
label: "ERa2";
alternative_railtype_list: ["BDAa", "SDAa", "BDAA", "SDAA", "BDBa", "SDBa", "BDBA", "SDBA", "BDCa", "SDCa", "BDCA", "SDCA", "BDDa", "SDDa", "BDDA", "SDDA", "BDEa", "SDEa", "BDEA", "SDEA", "ELRL", "RAIL"];
}
Image Image Image Image

User avatar
George
Tycoon
Tycoon
Posts: 4327
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: SPb, Russia.
Contact:

Re: New Railtype Label Scheme

Post by George »

I've tried

Code: Select all

 /// railtypetable
railtypetable {
  RAIL_1435: [SAAN, SABN, SACN, SADN, SAEN, RLA0, RLA1, RLA2, RLA3, RAIL], 
...
  EL4S_1435: [SAAE, SABE, SACE, SADE, SAEE, EL4S, ELRL, RAIL]  
}
and get
nmlc ERROR: nmlc: An internal error has occurred:
nmlc-version: 0.5.0
Error: (TypeError) "expected string or bytes-like object".
Command: ['nmlc', '--grf=xussr-addon.grf', '-c', '--nfo=xussr-addon.nfo', '--nml=xussr-addon_optimized.nml', '-M', '--MF=xussr-addon_dep.txt', 'xussr-addon.nml'] Location: File "nml\expression\__init__.py", line 47, in identifier_to_print

when I comment code inside table, problem disappears. What am I doing wroong?

Update:

Changed to NMLC 0.5.2, that fixed the problem

I've made a new version and new question is - why do dutch trains for DC1500V use broad rails, while other trains do not. What should I change?
Attachments
railtrack.pnml
(44.64 KiB) Downloaded 8 times
xussr-rails.grf
(200.02 KiB) Downloaded 6 times
Image Image Image Image

Transportman
Tycoon
Tycoon
Posts: 2743
Joined: 22 Feb 2011 18:34

Re: New Railtype Label Scheme

Post by Transportman »

I think that is because other trainsets have their trains defined as ELRL, which your code does not provide and thus is provided by the game itself, while the Dutch Trains uses SABD for the 1500V DC tracks, which you do provide.

The default tracks provided by the game are a bit special, you need to explicitly override them, having ELRL only as an alternative railtype for tracks in your code does not do anything.

[Edit]I missed your earlier reply, I'll try to answer all questions with a general explanation how tracktypes work between train sets and track sets. I'll start with the train sets.

Train sets have 2 things related to tracktypes in a trainset:
  • The railtypetable
  • The track_type property on a vehicle that points to an entry in the railtypetable
The railtypetable contains basically a list that informs OpenTTD how the NewGRF wants to map track_type to a label in a trackset and which one should take precedence if multiple labels are available. Most electric vehicles in the Dutch Trainset have track_type DC_B. In the railtypetable that is defined as:

Code: Select all

DC_B: [SABd, SABD, SABE, ELRL]
This tells OpenTTD that for a train with track_type DC_B, it wants a track with label SABd. Is no trackset providing SABd, it will want a track with label SABD and so on. The last entry, ELRL, is the default electric track always available in OpenTTD, so even if no trackset is loaded or providing any of the requested labels, this vehicle will become available because of that.

Metros use metro_B as track_type, which is defined in the railtypetable as:

Code: Select all

metro_B: [SAB3, MTRO, "3RDR"],
Now there is no OpenTTD default label in the list, so if no trackset is loaded or providing the requested label, the vehicle will not become available as there is no track to run it on.

Now for tracksets, there are two properties related to the above:
  • The label
  • The alternative_railtype_list
The alternative_railtype_list is nothing more that a list of labels that your track can also be if that label is not defined by another set or OpenTTD itself. So if you have a track defined with label SAXd and in the alternative_railtype_list you included SABd, all trains with track_type DC_B in the Dutch Trainset would use that track because it could find SABd in the alternative_railtype_list as long as it is not defined by your or any other set. It would then use the compatible_railtype_list and powered_railtype_list of the SAXd track defined in your set (see below for explanation).

Little note, I do not know what the order of preference is for OpenTTD, if it would prefer an exact match later in the trainset railtypetable over a match with the alternative_railtype_list for an earlier entry.

Then there are 2 properties related to compatibility and being powered:
  • The compatible_railtype_list
  • The powered_railtype_list
Those define the behavior of a train for that track type (as explained above) on other track types. The first specifies if a train that has a track_type that matches a broad gauge track in you set, can only be moved onto other broad gauge tracks, the second specifies for engines if they would also provide power on that other track (for example, if overhead catenary is present or not). Those lists work one way, so if SAXd defines in its compatible_railtype_list that it is compatible with XAXd but XAXd does not have SAXd in its own compatible_railtype_list, trains that have SAXd as their label can run on XAXd but trains that have XAXd as their label cannot run on SAXd.

For the default tracks, MONO and MGLV have both lists empty, while RAIL and ELRL have the following:
RAIL: compatible_railtype_list:ELRL - powered_railtype_list: ELRL
ELRL: compatible_railtype_list:RAIL - powered_railtype_list: empty

Some of the other questions in your post:
-No, you cannot disable the default railtypes, you should override them to something sensible. In the Dutch Trackset, I used RAIL as the normal unelectrified track, and ELRL as some slow yard rail that is compatible with everything.
-The Dutch Trainset should already use the SABd, but it might give some unexpected results because of one of the _railtype_lists not being defined correctly
-Old names should be as part of the alternative_railtype_list in the trackset
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML

User avatar
George
Tycoon
Tycoon
Posts: 4327
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: SPb, Russia.
Contact:

Re: New Railtype Label Scheme

Post by George »

[*X**] Speed limit class
Always use class A for every vehicle.
It looks like a mistake in the schema, because allows using high speed railways by some small old steam locomotives. Axle load limits would not help, because they can be low for the small steamer.
What was intended by this rule?
Image Image Image Image

User avatar
George
Tycoon
Tycoon
Posts: 4327
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: SPb, Russia.
Contact:

Re: New Railtype Label Scheme

Post by George »

I can't understand, something does not match.
Dutch trains set defines TGV train as

Code: Select all

track_type: dual_B;
railtype table defines

Code: Select all

dual_B: [SABE, SABA, ELRL],
xussr rails set defines ERD1 rails as

Code: Select all

alternative_railtype_list: [
"BBAD", "BBBD", "BBCD", "BBDD", "BBED",
"BAAD", "BABD", "BACD", "BADD", "BAED",
                                
"SBAD", "SBBD", "SBCD", "SBDD", "SBED",
"SAAD", "SABD", "SACD", "SADD", "SAED"];
and TGV is available in ERD1 depot. WHY????
Image Image Image Image

Transportman
Tycoon
Tycoon
Posts: 2743
Joined: 22 Feb 2011 18:34

Re: New Railtype Label Scheme

Post by Transportman »

George wrote:
16 Aug 2020 07:23
[*X**] Speed limit class
Always use class A for every vehicle.
It looks like a mistake in the schema, because allows using high speed railways by some small old steam locomotives. Axle load limits would not help, because they can be low for the small steamer.
What was intended by this rule?
The idea is that a track with speed limit A is always available (the lowest speed). Higher speed tracks are then defined as compatible and powered in the list of *A**. It is a player responsibility to not run old steam locomotives on fancy high speed tracks. You could prohibit running slow steamers on high speed track by not defining those high speed tracks as compatible in *A** but do define *A** as compatible in the high speed tracks and then define your high speed trains on *B**, but that might break with other trainsets.
George wrote:
16 Aug 2020 08:29
I can't understand, something does not match.
Dutch trains set defines TGV train as

Code: Select all

track_type: dual_B;
railtype table defines

Code: Select all

dual_B: [SABE, SABA, ELRL],
xussr rails set defines ERD1 rails as

Code: Select all

alternative_railtype_list: [
"BBAD", "BBBD", "BBCD", "BBDD", "BBED",
"BAAD", "BABD", "BACD", "BADD", "BAED",
                                
"SBAD", "SBBD", "SBCD", "SBDD", "SBED",
"SAAD", "SABD", "SACD", "SADD", "SAED"];
and TGV is available in ERD1 depot. WHY????
I think that is because ERD1 is in a powered_railtype_list of a track that has SABE or SABA as label or in its alternative_railtype_list.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML

Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 595
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: New Railtype Label Scheme

Post by Michi_cc »

There seems to be some confusion about the purpose of the alternate labels and the interaction with powered/compatible railtypes. In the realm of the standardized label scheme, have a railtype e.g. provide alternate labels for both broad and standard gauge doesn't make sense.

Let's break this up into a simplified step by step process (all info here taken from https://newgrf-specs.tt-wiki.net/wiki/S ... ype_Scheme, no warranty included).

Part 1: Track set

A) Which tracks?
Start with a list of track types your set should provide. For sake of this example, let's say we want:
  1. Standard gauge, no specific speed or axle load
  2. Standard gauge with AC overhead electrification, normal speed, no specific axle load
  3. Standard gauge with AC overhead electrification, high speed, no specific axle load
  4. Broad gauge, low axle load
  5. Broad gauge, high axle load
  6. Dual gauge track, standard + broad, low speed only, all axle loads
This is obviously just for example and not a sensible set design.

B) Assigning track labels
For each track, we have to select a railtype label that is used to define and code the railtype in the track NewGRF. For this, we refer to the wiki page of the standardized scheme.
The four letters of the label are assigned specific meanings in the scheme. These are - from left to right - track type/gauge, speed limit, axle load, and energy source.

The speed limit component needs some more info: The scheme assumes that tracks with different speed limits are cross-compatible, e.g. low speed vehicles can drive on high speed tracks and vice versa. If you want a set design where e.g. a TGV can drive only on high-speed tracks, you need to select one of the other label components to differentiate this! The speed limit is also the component to use for eye-candy things and some special behaviour (in conjunction with a train set): E.g. if you have trains that drive on normal rails but can optionally also engage to a rack rail, you'd assign rails with rack to one speed letter (normally R), which the train set can then query to maybe have a higher TE on rack sections.

Let's assign labels to our six types (I'll put some notes after each label):
  1. SAAN - if there's no specific speed or axle load, always start with A
  2. SAAA - A is for AC overhead electrification; E would be any overhead electrification, we'll come back to this later!
  3. SBAA - Higher speeds just use the next letter (B). The letters have no fixed defined speed.
  4. BAAN - Standard axle load classes are are from A to E. In this case, we define "low" axle load to be A-C and "high" to be D-E.
  5. BADN - (see above)
  6. DAAN - D is for broad + standard
Now, we need to consider the built-in railtypes RAIL and ELRL. As you can't really remove them without messing with all other NewGRFs, we instead resort to redefining them. As such, we'll pick a rail type from out list above to use for each label. The label to pick should be the one you want random vehicles from other NewGRFs to use. This does not necessarily always has to be standard gauge, but in this example we'll pick SAAN and SAAA. Our final physical railtype labels thus become:
  1. RAIL
  2. ELRL
  3. SBAA
  4. BAAN
  5. BADN
  6. DAAN
These labels are important as railtype props 08/0E/0F/18/19 (label/compatible/powered/introduced/introduces) only work with these physical labels, not any alternate labels defined.

C) Defining the tracks
Now you can start writing your railtype NewGRF. Define railtype with the above physical labels and whatever graphics/props/etc you want. I'm not going to write about that except for compatible/powered and alternate label props. Railtype that you want to have a speed limit (ELRL/SAAA and SBAA here) get one.

Powered/compatible first, alternate after that:
  1. RAIL - Vehicles should also be able to drive and have power on electrified and dual gauge track. Thus powered and compatible: ELRL, SBAA, DAAN
  2. ELRL - Vehicles should be powered on all electrified types: SBAA; vehicles should be compatible but unpowered on other tracks on the same gauge: RAIL, DAAN
  3. SBAA - Technically not needed, as no vehicle should ever have this type, but if you want to be safe: ELRL / RAIL, DAAN
  4. BAAN - Vehicles should be compatible and powered on higher axle loads and dual gauge track, powered/compatible: BADN, DAAN
  5. BADN - Vehicle should run on dual gauge track but not on lower axle load, powered/compatible: DAAN
  6. DAAN - Either nothing, or to cheese a bit for variable gauge vehicles: powered/compatible: RAIL, ELRL, BAAN, BADN
DAAN should also only be available if both standard gauge and broad gauge tracks are available, thus we set the intro date to 0, but list RAIL and BAAN for prop 18 (requires_railtype_list).

Now we come to the alternate labels. First some general rules to comply with the standardised scheme (these rules are a convention within the scheme, not by OpenTTD):
  1. For each combination of track type/gauge and energy source, you must provide all axle load classes from A to E, either as a real railtype or an alternate label.
  2. Speed class A must always be defined for each track type/gauge, energy source, and axle load.
  3. If you use one the the specialised energy source letters (see wiki for a table), provide alternates for a matching generic letter
  4. If you substituted one of the scheme labels by one of the built-in labels (RAIL/ELRL/...), list the original label as an alternate
  5. If there are any legacy railtype labels you want to support (e.g. for backwards compatibility with older NewGRF releases), add them as alternate, too
This leads to the following alternate labels for each railtype:
  1. RAIL - SAAN, SABN, SACN, SADN, SAEN (rules a, b, d)
  2. ELRL - SAAA, SABA, SACA, SADA, SAEA, SAAE, SABE, SACE, SADE, SAEE (rules a, b, c, d, with E chosen for generic overhead electrification)
  3. SBAA - (none, vehicles should never use speed letter B)
  4. BAAN - BABN, BACN (rules a, b, with axle loads D/E provided by the next track type)
  5. BADN - BAEN (rules a, b, with axle loads A-C provided by the previous track type)
  6. DAAN - DABN, DACN, DADN, DAEN (rules a, b)
Part 2: Train set

Summary: Each rail vehicle has its defined railtype. Select the best matching type according to the standardized scheme. Depending on the intentions of your set design, strategically add fallbacks to the railtype table.

A) Selecting the best track type
Build the primary railtype label by selecting each label component: track type/gauge, speed limit, axle load, and energy source.
  • Select the track type according to the list, for our example either S or B (and maybe D for e.g. variable gauge wagons).
  • Always and only use A for the speed limit letter.
  • Select an axle load, using the full range from A to E for your vehicles.
  • Select an appropriate energy source. Whether you use only the generic energy source letters or the more specialised letters depends on your set design.
Let us select a few primary railtypes for some pretend vehicle types:
  1. Light steam/diesel vehicles on standard gauge: SABN
  2. Heavy steam/diesel vehicles on standard gauge: SADN
  3. Normal AC overhead vehicles on standard gauge: SACA (we use the more specialised A for energy source as we maybe want to add some DC vehicles later)
  4. Light shunters on broad gauge: BAAN
  5. Medium vehicles on broad gauge: BACN
  6. Heavy vehicles on broad gauge: BAEN
  7. Variable gauge wagons: DACN (we pretend they are all quite heavy and have a higher axle load)
Please note that the selected labels are not identical to the physical labels we've defined in the track NewGRF. The whole point of the standardized railtype scheme is to provide a decoupling between train and track sets, to allow mixing and matching different sets.

B) Selecting fallback track types
Depending on your set design ideas, you'll probably want to add some fallback types to make your train NewGRF playable even if not used with the exact matching track NewGRF.
  • Track type: Depends. If, for example, you want broad gauge vehicles to be available to the player even if no track set with broad gauge is loaded, add a fallback to the equivalent standard gauge label. Probably more relevant if you e.g. have narrow and narrower gauge (N and n), to map the narrower gauge to generic narrow gauge. Simply letting vehicles be unavailable by not defining a fallback is also a valid artistic choice.
  • Speed letter: As you shouldn't have used anything except A, no fallbacks needed.
  • Axle load: Track NewGRFs that don't provide A-E do not conform to the standardized scheme, and thus no fallbacks needed for non-broken sets.
  • Energy source: Depends again. Providing or not providing a fallback is an artistic choice. It is recommended to provide a fallback from specialized energy sources (like AC and DC overhead) to the generic energy source, but not required.
  • Old/legacy track types: If you want to support old track NewGRFs with different labels, these can be added to the fallback as well.
  • No or non-standardized scheme track NewGRF: Provide fallbacks to RAIL/ELRL if you want your train set to work without a loaded track NewGRF. Please note that fallbacks to RAIL/ELRL will generally mean that all of your vehicles can be build in some depot type that you can't control if using a non-standardized scheme track NewGRF. If you don't provide these fallbacks, expect bug reports from people who can't read.
Taking these rules into account, a railtype table could look like this (assuming players should always get all vehicles somewhere):
  1. t_SABN: [SABN, OLD1, RAIL]
  2. t_SADN: [SADN, OLD1, RAIL]
  3. t_SACA: [SACA, SACE, OLD2, ELRL]
  4. t_BAAN: [BAAN, SAAN, OLD3, RAIL]
  5. t_BACN: [BACN, SACN, OLD3, RAIL]
  6. t_BAEN: [BAEN, SAEN, OLD3, RAIL]
  7. t_DACN: [DACN, BACN, SACN, RAIL] (could have left out the BACN depending on the intention)
Part 3: Bla bla

Too long, didn't read. Refer to the wiki page. All values are just for example and not good set design. Not tested or coded, might be full of mistakes and holes.

User avatar
George
Tycoon
Tycoon
Posts: 4327
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: SPb, Russia.
Contact:

Re: New Railtype Label Scheme

Post by George »

Hello
Thank you for detailed reply.
May be I'm understanding the intentions wrong, but at least checking xUSSR trains, xUSSR rails, Dutch trains, Dutch tracks in different combinations work quit good. Would be nice to check with some other sets through.

I did something different, but I can't understand, why should it be wrong.

Part 1: Track set
A) Which tracks?
A list of Broad gauges with 6 speeds limits (from 60 to unlim), no axle limits.
Electrification 1500V DC 3000V DC 15kV AC 25kV AC
2 combo rails (with tracks) and 4 combo rails (without tracks)

B) Assigning track labels
I used old labels like ERA1 and I can't understand what is wrong in it, because schema-based labels can be used in alternatives list.
"RLA0", "RLA1", "RLA2", "RLA3" - not electrified
"ERA1", "ERA2", "ERA3", "ERA4" - electrified 25kV AC
"ERa0", "ERa1", "ERa2", "ERa3", "ERa4" - electrified 15kV AC
"ERD1", "ERD2", "ERD3" - electrified 3kV DC
"ERd0", "ERd1", "ERd2", "ERd3" - electrified 1.5kV DC
"ER2D", "ER2S" - several electrifications with tracks
"ER2s", "ER3a", "ER3D", "ER4S" - several electrifications without tracks
Also I can't understand why ELRL and RAIL should be overridden. I didn't do it, and when I load xUSSR rails + Dutch trains I do not get them in the menu

C) Defining the tracks
Compatible - all rails in the set
Powered
RLA* - all
25 kV AC - "ERA1", "ERA2", "ERA3", "ERA4", "ER2S", "ER2s", "ER3a", "ER3D", "ER4S"
15 kV AC - "ERa0", "ERa1", "ERa2", "ERa3", "ERa4", "ER3a", "ER4S"
3 kV DC - "ERD1", "ERD2", "ERD3", "ER2D", "ER2S", "ER3D", "ER4S"
1.5 kV DC - "ERd0", "ERd1", "ERd2", "ERd3", "ER2D", "ER2s", "ER3a", "ER3D", "ER4S"
dDC (1.5 kV DC + 3 kV DC) - "ERD1", "ERD2", "ERD3", "ERd0", "ERd1", "ERd2", "ERd3", "ER2D", "ER2S", "ER2s", "ER3a", "ER3D", "ER4S"
ACDC (3 kV DC + 25 kV AC) - "ERA1", "ERA2", "ERA3", "ERA4", "ERD1", "ERD2", "ERD3", "ER2D", "ER2S", "ER2s", "ER3a", "ER3D", "ER4S"
ACdDC (1.5 kV DC + 3 kV DC + 25 kV AC) - "ERA1", "ERA2", "ERA3", "ERA4", "ERd0", "ERd1", "ERd2", "ERd3", "ERD1", "ERD2", "ERD3", "ER2D", "ER2S", "ER2s", "ER3a", "ER3D", "ER4S"
AC15DC (1.5 kV DC + 25 kV AC) - "ERA1", "ERA2", "ERA3", "ERA4", "ERd0", "ERd1", "ERd2", "ERd3", "ER2D", "ER2S", "ER2s", "ER3a", "ER3D", "ER4S"
aACdDC (all 4) - "ERa0", "ERa1", "ERa2", "ERa3", "ERa4", "ERA1", "ERA2", "ERA3", "ERA4", "ERd0", "ERd1", "ERd2", "ERd3", "ERD1", "ERD2", "ERD3", "ER2D", "ER2S", "ER2s", "ER3a", "ER3D", "ER4S"
aAC15DC (1.5 kV DC + 15 kV AC + 25 kV AC) - "ERa0", "ERa1", "ERa2", "ERa3", "ERa4", "ERA1", "ERA2", "ERA3", "ERA4", "ERd0", "ERd1", "ERd2", "ERd3", "ER2D", "ER2S", "ER2s", "ER3a", "ER3D", "ER4S"

alternate labels
For example ERa1 has
alternative_railtype_list: ["BBAa", "BBBa", "BBCa", "BBDa", "BBEa",
"BAAa", "BABa", "BACa", "BADa", "BAEa",

"BBAA", "BBBA", "BBCA", "BBDA", "BBEA",
"BAAA", "BABA", "BACA", "BADA", "BAEA",

"SBAa", "SBBa", "SBCa", "SBDa", "SBEa",
"SAAa", "SABa", "SACa", "SADa", "SAEa",

"SBAA", "SBBA", "SBCA", "SBDA", "SBEA",
"SAAA", "SABA", "SACA", "SADA", "SAEA"];
Impotent note. then searching among alternative names, OTTD picks up the first rail that has the label. Because of that there is no profit to specify the alternative label twice (for two different railways)

What do we see here?
- no ELRL or RAIL as alternatives
- both Broad and standard
- both low and high voltage
for combos no alternatives are provided.
So
rule a - almost done, except combos
rule b - almost done, except combos
rule c - ignored
rule d - unused
rule e - unused

What do we get with Dutch trains?
Steamers and Diesels - anywhere
1500V DC - on the 1500V rails
Duals - on the the 1500V and 25kV rails
As intended.

I broke almost half of rules, but it still works.

What are the other sets that use AC and DC to check with?
Image Image Image Image

Transportman
Tycoon
Tycoon
Posts: 2743
Joined: 22 Feb 2011 18:34

Re: New Railtype Label Scheme

Post by Transportman »

George wrote:
18 Aug 2020 07:50
I used old labels like ERA1 and I can't understand what is wrong in it, because schema-based labels can be used in alternatives list.
I think nothing is wrong with that, as you can always give the schema-based labels as alternatives.
Also I can't understand why ELRL and RAIL should be overridden. I didn't do it, and when I load xUSSR rails + Dutch trains I do not get them in the menu
The ELRL and RAIL are provided by the base game, which is why you need to override those explicitly. What might happen in the combination xUSSR rails+Dutch trains, is that the Dutch trains are all matched to tracks in the xUSSR set, resulting in the default RAIL and ELRL not being available in the menu as there are no vehicles for it. But when using a trainset that uses the default labels, you will not see the xUSSR tracks as there are then no vehicles for it.
Impotent note. then searching among alternative names, OTTD picks up the first rail that has the label. Because of that there is no profit to specify the alternative label twice (for two different railways)
This would also apply over different track sets, where NewGRF load order also comes into play, but any label always has priority over the alternative_railtype_list.
What do we get with Dutch trains?
Steamers and Diesels - anywhere
1500V DC - on the 1500V rails
Duals - on the the 1500V and 25kV rails
As intended.

I broke almost half of rules, but it still works.
It seems to work because of the reasons I explain earlier in this post, but I think things break down with trainsets that do nothing with railtypes and just use about the default labels.
What are the other sets that use AC and DC to check with?
I'm not aware of any.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML

User avatar
George
Tycoon
Tycoon
Posts: 4327
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: SPb, Russia.
Contact:

Re: New Railtype Label Scheme

Post by George »

In case Dutch trains set is the only set that uses both AC and DC, it is very hard to be sure :(
Is there any track set that uses AC + DC except Dutch tracks?
Image Image Image Image

MLG
Engineer
Engineer
Posts: 5
Joined: 07 Sep 2020 15:12

New Railtype Label Scheme: labeling trouble

Post by MLG »

Hi all,
I have run into problem, while choosing labels for my developed tracks. They will include narrow gauge tracks and narrow gauge rack railway tracks, both normal and eletrified. IRL there are some trains, which are able to run on both types, so I want to support that. But some trains can run only on one of them (either normal, or rack tracks). So I thougth about adding special alternative label for train developers to make said trains. But, in wiki page, there are lot of options about, how to label tracks, but there is no option for case, I want to make... Should I use custom label, or will somebody of you introduce a new label for it? IMHO best option would be: NRHN and NRHE, while making use of, in this track set, unused axle weigth slot.

Thanks, MLG
You can write to me in English, or Czech.
Můžete mi psát česky, nebo anglicky.

Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 1 guest