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
Wolf01
Tycoon
Tycoon
Posts: 2013
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Re: NotRoadTypes

Post by Wolf01 » 02 May 2019 21:04

Yay, thank you everybody :D

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

Re: NotRoadTypes

Post by acs121 » 03 May 2019 00:20

Maybe you should also thank yourself for everything you did for NRT ? :D

User avatar
Andrew350
Route Supervisor
Route Supervisor
Posts: 484
Joined: 19 Dec 2011 07:54
Location: Washington State, USA
Contact:

Re: NotRoadTypes

Post by Andrew350 » 03 May 2019 06:06

Awesome job everyone, thank you for your hard work! I've been looking forward to this day for a long time :D

In celebration I thought I'd upload my NRT NewGRF (RattRoads) to Bananas to give the broader audience something to play with, unfortunately I ran into a problem: Bananas doesn't seem to recognize OpenTTD's new versioning format, so there seems to be no way of limiting these new features to the latest nightlies. On a lark I set the Minimum OpenTTD version to 20190502, which surprisingly it accepted, but my NewGRF still appears even in 1.9.1. I was skeptical it would work at all since Bananas doesn't seem to have been updated in like 3 years (1.6.0 is still newest version listed :P ), but I figured if anything it would fail on the format being wrong. But I guess not.

So yeah, I tried to put an NRT NewGRF on the online content, but unfortunately it's either available to everybody or nobody due to missing version support, so I've "hidden" it for now :lol:

(On a related side note, can NewGRFs themselves even detect OpenTTD versions any more? I can't find any info on an updated format, I know it was talked about but don't know if one was ever decided on and implemented.)

Thanks again! :bow:

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

Re: NotRoadTypes

Post by wallyweb » 03 May 2019 09:46

Andrew350 wrote:(On a related side note, can NewGRFs themselves even detect OpenTTD versions any more? I can't find any info on an updated format, I know it was talked about but don't know if one was ever decided on and implemented.)
If I read your question right, this has been possible for the longest time. It is set out as a global variable in the NewGRF Specifications. I don't do NML so I can't say if it is supported there, but I would imagine that it is.

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

Re: NotRoadTypes

Post by wallyweb » 03 May 2019 10:25

wallyweb wrote:
andythenorth wrote:The first page of this thread has links to forks of NML with NRT support. A proper release of NML will also be needed for this, we'll get to that.
Will the sample NewGRF Specifications need modifications or are they complete as linked to in the first post?
peter1138 wrote:I'll have time to go through them tonight and make them tentatively official. There's a couple of additional flags (town can build and hidden) but no major changes.
A daunting task. :wink:
Hopefully you'll be able to update the NewGRF Specifications wiki as well as the NML equivalent.
Just a simple request once that is done ... Ask adythenorth to add to his first post prominent links to the respective pages. 8)

arikover
Route Supervisor
Route Supervisor
Posts: 391
Joined: 15 Jun 2007 09:27
Skype: madchimiste
Location: Berlin, Deutschland

Re: NotRoadTypes

Post by arikover » 03 May 2019 11:07

Congratulations for this new feature!

Is an update of grfcodec/nforenum also planned?

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

Re: NotRoadTypes

Post by andythenorth » 03 May 2019 12:29

arikover wrote:Is an update of grfcodec/nforenum also planned?
grfcodec fortunately just works with NRT, no changes needed :D

nforenum is no longer maintained as far as I know, so probably won't get updated unless somebody volunteers :)

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

Re: NotRoadTypes

Post by wallyweb » 03 May 2019 12:39

andythenorth wrote:nforenum is no longer maintained as far as I know, so probably won't get updated unless somebody volunteers :)
Pity. It is so very good at finding missing ";" and line breaks and reminding us of the erers of our ways :cry:

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

Re: NotRoadTypes

Post by peter1138 » 03 May 2019 12:45

andythenorth wrote:nforenum is no longer maintained as far as I know
Can you please stop again with the bulls*** spreading? It's part of grfcodec, it's under our wing, it will be updated.
He's like, some kind of OpenTTD developer.

User avatar
Andrew350
Route Supervisor
Route Supervisor
Posts: 484
Joined: 19 Dec 2011 07:54
Location: Washington State, USA
Contact:

Re: NotRoadTypes

Post by Andrew350 » 03 May 2019 14:16

wallyweb wrote:
Andrew350 wrote:(On a related side note, can NewGRFs themselves even detect OpenTTD versions any more? I can't find any info on an updated format, I know it was talked about but don't know if one was ever decided on and implemented.)
If I read your question right, this has been possible for the longest time. It is set out as a global variable in the NewGRF Specifications. I don't do NML so I can't say if it is supported there, but I would imagine that it is.
Yes the feature is there and it still works for releases (I think), but as far as I know it expects a certain format for the nightly version (like r21234 or so), so I'm not sure if it will work with the new format (openttd-20190502-master-blahblahblah). Unless it just works, maybe I just don't know how to write it correctly? I thought I saw some talk on irc about a new internal version number system, but don't recall what ever came of it, if anything.

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

Re: NotRoadTypes

Post by wallyweb » 03 May 2019 16:10

Andrew350 wrote:Yes the feature is there and it still works for releases (I think), but as far as I know it expects a certain format for the nightly version (like r21234 or so), so I'm not sure if it will work with the new format (openttd-20190502-master-blahblahblah). Unless it just works, maybe I just don't know how to write it correctly? I thought I saw some talk on irc about a new internal version number system, but don't recall what ever came of it, if anything.
I think I see where you are coming from. Stable is currently at 1.9.1 When OTTD went to stable, I think master went to 1.10.0, but that is of little help when there is a new master almost every night. The problem is that github randomly generates a new number. Why not do a test and test for 1.10? If that works, at least you'll know you're not working with stable.

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

Re: NotRoadTypes

Post by andythenorth » 03 May 2019 17:02

peter1138 wrote:Can you please stop again with the bulls*** spreading? It's part of grfcodec, it's under our wing, it will be updated.
To be more accurate, the most active former maintainers have either left (rubidium), or have said they will not maintain it (frosch).

But contributions are welcome https://github.com/OpenTTD/grfcodec

User avatar
Andrew350
Route Supervisor
Route Supervisor
Posts: 484
Joined: 19 Dec 2011 07:54
Location: Washington State, USA
Contact:

Re: NotRoadTypes

Post by Andrew350 » 03 May 2019 17:06

wallyweb wrote:Why not do a test and test for 1.10? If that works, at least you'll know you're not working with stable.
Yeah I thought about that after posting. Honestly I'm a bit skeptical but if it works that might be okay for now (still not ideal though). I'll have to test once I get home :)

User avatar
Wolf01
Tycoon
Tycoon
Posts: 2013
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Re: NotRoadTypes

Post by Wolf01 » 03 May 2019 19:59

acs121 wrote:Maybe you should also thank yourself for everything you did for NRT ? :D
Nah, I just started it all with Andy, other people did really more work ;)

arikover
Route Supervisor
Route Supervisor
Posts: 391
Joined: 15 Jun 2007 09:27
Skype: madchimiste
Location: Berlin, Deutschland

Re: NotRoadTypes

Post by arikover » 03 May 2019 21:14

andythenorth wrote:
peter1138 wrote:Can you please stop again with the bulls*** spreading? It's part of grfcodec, it's under our wing, it will be updated.
To be more accurate, the most active former maintainers have either left (rubidium), or have said they will not maintain it (frosch).

But contributions are welcome https://github.com/OpenTTD/grfcodec
Well, nice to hear that grfcodec already works with NRT, and nice to hear that nforenum was not forgotten...

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

Re: NotRoadTypes

Post by Eddi » 04 May 2019 05:39

wallyweb wrote:
Andrew350 wrote:Yes the feature is there and it still works for releases (I think), but as far as I know it expects a certain format for the nightly version (like r21234 or so), so I'm not sure if it will work with the new format (openttd-20190502-master-blahblahblah). Unless it just works, maybe I just don't know how to write it correctly? I thought I saw some talk on irc about a new internal version number system, but don't recall what ever came of it, if anything.
I think I see where you are coming from. Stable is currently at 1.9.1 When OTTD went to stable, I think master went to 1.10.0, but that is of little help when there is a new master almost every night. The problem is that github randomly generates a new number. Why not do a test and test for 1.10? If that works, at least you'll know you're not working with stable.
the check for 1.9 vs. 1.10 still works, but with the move to git as the main repository, there is no linear revision number anymore. so you cannot do any checks like "was this before or after NRT merge?" currently, unless someone invents a new counting method, and puts that into the build system. (PRs welcome, i guess)
You might not exactly be interested in Ferion, but if you are, have fun :)

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

Re: NotRoadTypes

Post by wallyweb » 04 May 2019 09:42

Eddi wrote:the check for 1.9 vs. 1.10 still works, but with the move to git as the main repository, there is no linear revision number anymore. so you cannot do any checks like "was this before or after NRT merge?" currently, unless someone invents a new counting method, and puts that into the build system. (PRs welcome, i guess)
:bow:
I'll make an assumption here. NRT has been merged into master. Once it has passed muster and the merge is found to be stable, OTTD stable will move to 1.10 and master to 1.11.
@Andrew350 - Do you need to test for changes to master, or will a simple "stable/not stable" test satisfy what you need?

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

Re: NotRoadTypes

Post by wallyweb » 04 May 2019 10:51

peter1138 wrote:I'll have time to go through them tonight and make them tentatively official. There's a couple of additional flags (town can build and hidden) but no major changes.
DISCLAIMER: Not being pushy. I understand that this will be done when it is done.
A question concerning town zones and "town can build".
The pro-forma by Frosch cites a property: 0x14 speed_limit
and a variable: 0x44 town_zone Currently not available for bridges and stations.
Railtypes (feature 10) says: variable 44 Town zone of the tile. (Only available for level crossings and depots.)
If a town can build roads, can a grf tell the town which road type to build in each town zone?
Town zones shift as a town grows. Will the road type evolve and more specifically will the speed limit property follow?
An example: Town zone 5 (road type A) speed limit 30 km/h; Town zone 4 (road type B) speed limit 50 km/h

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

Re: NotRoadTypes

Post by Eddi » 04 May 2019 11:09

wallyweb wrote:If a town can build roads, can a grf tell the town which road type to build in each town zone?
no, the GRF only tells the town which roadtypes are available for building in general. the town makes the final decision of which road to build. the decision how that is done might be made available to some town ai type thing in the distant future
Town zones shift as a town grows. Will the road type evolve and more specifically will the speed limit property follow?
no, properties are fixed, they cannot change depending on town zone. (that would require a callback, and probably some place to cache the callback result)
You might not exactly be interested in Ferion, but if you are, have fun :)

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

Re: NotRoadTypes

Post by wallyweb » 04 May 2019 12:01

Eddi wrote:
wallyweb wrote:If a town can build roads, can a grf tell the town which road type to build in each town zone?
no, the GRF only tells the town which roadtypes are available for building in general. the town makes the final decision of which road to build. the decision how that is done might be made available to some town ai type thing in the distant future
Town zones shift as a town grows. Will the road type evolve and more specifically will the speed limit property follow?
no, properties are fixed, they cannot change depending on town zone. (that would require a callback, and probably some place to cache the callback result)
Thanks Eddi. So if I understand you correctly, when a player starts a new game, there will be no speed limits anywhere until the player overbuilds a road with a road type and if the player wants to maintain zone specific speed limits the player will have to monitor the towns as they grow?

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 3 guests