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
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: NotRoadTypes

Post by wallyweb »

andythenorth wrote:
wallyweb wrote:Just in need of some fine tuning. :D
I know that's meant well, but it doesn't confuse me any less. There's multiple pages of this thread dedicated to figuring out how players can basically eliminate NRT. It seems very odd. I don't know why we bothered tbh :)
Sounds like purveyors of fake news are about. I don't think its so much questions as to "how to eliminate" but rather "How will/does/can this or that work". You've got Wolf01 and others in the kitchen. The project is in good hands. Ignore the naysayers (or borrow some tweets from Trump :wink: ).
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Re: NotRoadTypes

Post by Wolf01 »

wallyweb wrote:You've got Wolf01 and others in the kitchen.
I can make you a sandwich :lol:
Kruemelchen
Transport Coordinator
Transport Coordinator
Posts: 287
Joined: 18 Feb 2017 17:47

Re: NotRoadTypes

Post by Kruemelchen »

andythenorth wrote:There's multiple pages of this thread dedicated to figuring out how players can basically eliminate NRT. It seems very odd. I don't know why we bothered tbh :)
I don't really understand why you'd jump to this conclusion, the only derailment I saw was about HEQS not supporting HAUL-roads and how to solve that problem with minimum effort :wink:
(the small GRF I posted is of course not a real problem solver, it's more like a dual gauge solution, or that's what it shall be in my eyes.)

NRT is the realisation of a long time envisioned dream, at least that's why I bother creating GRFs which uses NRT features. If my coding skill was better, I'd even loved to jump into my github shoes and helped with the dev.

tbh alone the amount of attention NRT gets, reflects how this feature is actually wanted.
NRT is in my eyes totally playable by now, and GRFs will support it more and more.
(I alone have thousands of use cases drawn in my mind, that I want to realise :mrgreen: )

Of course there are players who want a maximum amount of freedom and therefore try to overcome obstacles on this way or another (ignoring the "how its meant to be played"), but other players (like myself) enjoy themselves to work around all the artificial restrictions like speed limits or HAUL vehicles.
In other words: for enough players NRT is a feature they dearly care about :bow:
User avatar
acs121
Tycoon
Tycoon
Posts: 1957
Joined: 03 Nov 2017 18:57
Location: Courbevoie, near Paris, France

Re: NotRoadTypes

Post by acs121 »

Man, NRT is fantastic. Look at supermop's Light Rail in Unspooled. If i could, i'd use it in every single game. Why would we eliminate something fantastic ?! We could have 15 roadtypes, 15 tramtypes, but yet not much GRFs are here.

I'd like to code a diesel Bombardier Talent for normal, unelectrified tram tracks. So i have two questions :
1 - Is it possible in NML ?
2 - Is there something like a Roadtype table just like the Railtype table ?
User avatar
supermop
Tycoon
Tycoon
Posts: 1104
Joined: 21 Feb 2010 00:15
Location: Fitzroy North - 96

Re: NotRoadTypes

Post by supermop »

acs121 wrote: Look at supermop's Light Rail in Unspooled.
To be fair, the light rail is just a tramway type. By itself, it doesn't need or have anything to do with NRT. NRT is the mechanism that allows multiple different types of tramway to exist, with different properties (speed, cost, powered-ness).
acs121 wrote:We could have 15 roadtypes, 15 tramtypes, but yet not much GRFs are here.
15 types are possible of course, but not necessary. I will intentionally try to provide fewer than 15 each in any GRF so that the user has room to load other GRFs. As for number of grfs - more grfs require more authors to make them. Recall that there were zero released Railtype grfs in before railtypes were added to trunk. The fact that anyone is making grfs for a non-trunk branch is noteworthy on its own.
acs121 wrote: I'd like to code a diesel Bombardier Talent for normal, unelectrified tram tracks. So i have two questions :
1 - Is it possible in NML ?
2 - Is there something like a Roadtype table just like the Railtype table ?
Yes, and yes, please look at the NRT specs. GRFs like Unspooled, and Mop Generic Vehicles make use of this. NRT specs also explain how types can be compatible or incompatible with one another.
User avatar
acs121
Tycoon
Tycoon
Posts: 1957
Joined: 03 Nov 2017 18:57
Location: Courbevoie, near Paris, France

Re: NotRoadTypes

Post by acs121 »

supermop wrote:
acs121 wrote: Look at supermop's Light Rail in Unspooled.
To be fair, the light rail is just a tramway type. By itself, it doesn't need or have anything to do with NRT. NRT is the mechanism that allows multiple different types of tramway to exist, with different properties (speed, cost, powered-ness).
acs121 wrote:We could have 15 roadtypes, 15 tramtypes, but yet not much GRFs are here.
15 types are possible of course, but not necessary. I will intentionally try to provide fewer than 15 each in any GRF so that the user has room to load other GRFs. As for number of grfs - more grfs require more authors to make them. Recall that there were zero released Railtype grfs in before railtypes were added to trunk. The fact that anyone is making grfs for a non-trunk branch is noteworthy on its own.
acs121 wrote: I'd like to code a diesel Bombardier Talent for normal, unelectrified tram tracks. So i have two questions :
1 - Is it possible in NML ?
2 - Is there something like a Roadtype table just like the Railtype table ?
Yes, and yes, please look at the NRT specs. GRFs like Unspooled, and Mop Generic Vehicles make use of this. NRT specs also explain how types can be compatible or incompatible with one another.
I found. The tramway is RAIL.

Is it correct like this :

Code: Select all

item (FEAT_ROADVEHS, item_tram_bombardier_talent) {
    property {
        name:                        string(STR_NAME_BOMBARDIER_TALENT);
        introduction_date:           date(1994,1,1);
        model_life:                  VEHICLE_NEVER_EXPIRES;
        retire_early:                0;
        vehicle_life:                25;
        loading_speed:               30;
        cost_factor:                 2;
        running_cost_factor:         11;
        speed:                       140 km/h;
        power:                       1500 hp;
        weight:                      57 ton;
        cargo_capacity:              (80*2);
        tractive_effort_coefficient: 0.5;
        air_drag_coefficient:        0;
        sound_effect:                SOUND_BUS_START_PULL_AWAY
        visual_effect:
        reliability_decay:           20;
        climates_available:          ALL_CLIMATES;
        refittable_cargo_classes:    bitmask(CC_PASSENGERS);
        sprite_id:                   SPRITE_ID_NEW_ROADVEH
        misc_flags:                  bitmask(ROADVEH_FLAG_TRAM);
        refit_cost:                  0
        running_cost_base:           RUNNING_COST_ROADVEH;
    }
    
    graphics {

    }
}
User avatar
acs121
Tycoon
Tycoon
Posts: 1957
Joined: 03 Nov 2017 18:57
Location: Courbevoie, near Paris, France

Re: NotRoadTypes

Post by acs121 »

Where is placed this property ? How must i write it ?
Kruemelchen
Transport Coordinator
Transport Coordinator
Posts: 287
Joined: 18 Feb 2017 17:47

Re: NotRoadTypes

Post by Kruemelchen »

acs121 wrote:Where is placed this property ? How must i write it ?
Under "property", I guess? :D
[+] Spoiler
try it like that:

Code: Select all

tram_type:   RAIL;
and don't forget to insert a tram type table somewhere above the vehicle definition and under the GRF header:

Code: Select all

tramtypetable { RAIL }
User avatar
acs121
Tycoon
Tycoon
Posts: 1957
Joined: 03 Nov 2017 18:57
Location: Courbevoie, near Paris, France

Re: NotRoadTypes

Post by acs121 »

Kruemelchen wrote:
acs121 wrote:Where is placed this property ? How must i write it ?
Under "property", I guess? :D
[+] Spoiler
try it like that:

Code: Select all

tram_type:   RAIL;
and don't forget to insert a tram type table somewhere above the vehicle definition and under the GRF header:

Code: Select all

tramtypetable { RAIL }
Like this, maybe ?

Code: Select all

tramtypetable { RAIL }

item (FEAT_ROADVEHS, item_tram_bombardier_talent) {
    property {
        tram_type:                   RAIL
        name:                        string(STR_NAME_BOMBARDIER_TALENT);
        introduction_date:           date(1994,1,1);
        model_life:                  VEHICLE_NEVER_EXPIRES;
        retire_early:                0;
        vehicle_life:                25;
        loading_speed:               30;
        cost_factor:                 2;
        running_cost_factor:         11;
        speed:                       140 km/h;
        power:                       1500 hp;
        weight:                      57 ton;
        cargo_capacity:              (80*2);
        tractive_effort_coefficient: 0.5;
        air_drag_coefficient:        0;
        sound_effect:                SOUND_BUS_START_PULL_AWAY
        visual_effect:
        reliability_decay:           20;
        climates_available:          ALL_CLIMATES;
        refittable_cargo_classes:    bitmask(CC_PASSENGERS);
        sprite_id:                   SPRITE_ID_NEW_ROADVEH
        misc_flags:                  bitmask(ROADVEH_FLAG_TRAM);
        refit_cost:                  0
        running_cost_base:           RUNNING_COST_ROADVEH;
    }
    
    graphics {

    }
}
xarick
Transport Coordinator
Transport Coordinator
Posts: 341
Joined: 26 Feb 2015 00:52

Re: NotRoadTypes

Post by xarick »

The tram-truck can reverse on its own at Frenfingwell City which is odd. The track isn't connected. If I remove the track, tram-truck won't be able to reverse.
Attachments
Nufingpool Bridge Transport, 10th Oct 1951.sav
(383.67 KiB) Downloaded 82 times
Nufingpool Bridge Transport, 26th May 1952.png
Nufingpool Bridge Transport, 26th May 1952.png (108.95 KiB) Viewed 3961 times
Formerly known as Samu
User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 721
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: NotRoadTypes

Post by Gwyd »

I feel like trunk will behave similarly

EDIT: A quick test shows it does not with trams.
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Re: NotRoadTypes

Post by Wolf01 »

A quick test shows it does
reversing.PNG
reversing.PNG (44.25 KiB) Viewed 3901 times
Meanwhile I fixed:
  • AIs trying to build adjacent stations
  • Road infrastructure count
User avatar
acs121
Tycoon
Tycoon
Posts: 1957
Joined: 03 Nov 2017 18:57
Location: Courbevoie, near Paris, France

Re: NotRoadTypes

Post by acs121 »

With some experimentations, mostly with RoadRunner, an AI that knows how to use tramways, here's a conclusion i made yesterday.
The NewGRFs used (only listing the RV-related ones) were Road Hog fork, Trolleybi, Ikarus Set 7 and Hungarian Truck Set 3.
  • Before buses & trucks appear, the AI will use steam tramways.
    When buses & trucks appear, the AI will not remove its old tramway lines.
    AI will not use HAUL roadtype, and will prefer standard road trucks.
    AI will not use ELRD roadtype, and will prefer standard buses.
    AI will not replace steam trams with another vehicle because of absence of another generation.
    However, AI will replace other road vehicles.
User avatar
acs121
Tycoon
Tycoon
Posts: 1957
Joined: 03 Nov 2017 18:57
Location: Courbevoie, near Paris, France

Re: NotRoadTypes

Post by acs121 »

xarick wrote:The tram-truck can reverse on its own at Frenfingwell City which is odd. The track isn't connected. If I remove the track, tram-truck won't be able to reverse.
Tram-truck ?
If it is a truck, it is normal that it can reverse that way. But for tramways, it is not.
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Re: NotRoadTypes

Post by Wolf01 »

Fixed:
  • Maintenance costs for roads, trams now have their own costs and might not match trunk
  • Cost of road when building a roadstop (drive-through) over your own road
  • Unable to build trams if no NRT grf is loaded (unspooled, docklands...)
Known bugs:
    Kruemelchen
    Transport Coordinator
    Transport Coordinator
    Posts: 287
    Joined: 18 Feb 2017 17:47

    Re: NotRoadTypes

    Post by Kruemelchen »

    I have another bug, I guess?, to report:

    I tried to adapt the max speed of a RV to the road type it's currently using.

    While the following code works as it, the corresponding switch is only executed, when I reload the GRF.
    In other words, the RV holds its current max speed it i.e. got on a slow road, even when it runs on another road type, it is set to get another max speed. Unless I hit the "accept" button in the GRF window, when the switch is finally executed.

    the code:

    Code: Select all

    roadtypetable { ROAD, OFFR, HAUL, SAND, DIRT, GRAV, ASPT } //roadtype translation table 
    switch(FEAT_ROADVEHS, SELF, set_speedperroad, current_roadtype) {
    	1..4: return (param["CS\01\02", 0] > 0 ? max(5/2, (param["CS\01\02", 0]*2/3)/2) : 20/2);	// set a slower max speed than allowed
    	default: return 100/2;	// original max speed of 100 km/h
    }
    item(FEAT_ROADVEHS, name, 31) {
    	[...]
    	graphics {
    		speed: set_speedperroad;
    	}
    }
    
    (btw I don't get why I have to subdivide the returned speed value by 2, but it work's ....)
    User avatar
    supermop
    Tycoon
    Tycoon
    Posts: 1104
    Joined: 21 Feb 2010 00:15
    Location: Fitzroy North - 96

    Re: NotRoadTypes

    Post by supermop »

    Kruemelchen wrote:I have another bug, I guess?, to report:

    I tried to adapt the max speed of a RV to the road type it's currently using.

    While the following code works as it, the corresponding switch is only executed, when I reload the GRF.
    In other words, the RV holds its current max speed it i.e. got on a slow road, even when it runs on another road type, it is set to get another max speed. Unless I hit the "accept" button in the GRF window, when the switch is finally executed.

    the code:

    Code: Select all

    roadtypetable { ROAD, OFFR, HAUL, SAND, DIRT, GRAV, ASPT } //roadtype translation table 
    switch(FEAT_ROADVEHS, SELF, set_speedperroad, current_roadtype) {
    	1..4: return (param["CS\01\02", 0] > 0 ? max(5/2, (param["CS\01\02", 0]*2/3)/2) : 20/2);	// set a slower max speed than allowed
    	default: return 100/2;	// original max speed of 100 km/h
    }
    item(FEAT_ROADVEHS, name, 31) {
    	[...]
    	graphics {
    		speed: set_speedperroad;
    	}
    }
    
    (btw I don't get why I have to subdivide the returned speed value by 2, but it work's ....)
    I sometimes get a similar issue with my dual-mode trucks: The horsepower and running cost seems to fluctuate correctly when going from electrified to un electrified, but the diesel smoke or electric sparks seem to stay stuck on whatever they started as
    User avatar
    andythenorth
    Tycoon
    Tycoon
    Posts: 5658
    Joined: 31 Mar 2007 14:23
    Location: Lost in Music

    Re: NotRoadTypes

    Post by andythenorth »

    Kruemelchen wrote:I have another bug, I guess?, to report:
    I tried to adapt the max speed of a RV to the road type it's currently using.
    Road vehicles cache properties; the cache invalidation was incomplete when entering a tile with a different road or tram type to previous.

    I've pushed a fix. https://github.com/andythenorth/NotRoad ... tram-types

    I'm guessing the new binary with the fix will be built roughly 03.00 UTC on Monday March 5th https://www.openttd.org/en/download-ratt
    Kruemelchen
    Transport Coordinator
    Transport Coordinator
    Posts: 287
    Joined: 18 Feb 2017 17:47

    Re: NotRoadTypes

    Post by Kruemelchen »

    andythenorth wrote:Road vehicles cache properties; the cache invalidation was incomplete when entering a tile with a different road or tram type to previous.
    Great, thank you for partly* fixing the problem!

    The max speed property is now recalculated, when the vehicle enters a tile with a different road type :D

    *However, said vehicle doesn't adapt to the new max speed, unless the vehicle stops and accelerates again (either manually, or by stopping at a station etc.)
    Post Reply

    Return to “OpenTTD Development”

    Who is online

    Users browsing this forum: No registered users and 31 guests