Have NML compilers default to NFO7?

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

Moderator: Graphics Moderators

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

Have NML compilers default to NFO7?

Post by kamnet »

Im not very up-to-speed on NML and the most recent improvements to the NFO spec, and honestly not much time to dig through it, so bear with me if I'm wrong about what I'm about to ask.

I've noticed that as NewGRF authors have started to migrate to NFO, that many of their works are being compiled with NFO8 specs, even though their projects don't take advantage of the newer features. The result is that their newer releases are not compatible with older versions of OpenTTD which don't support NFO8, but do support NFO7. When speaking to many of these authors, they say that they don't know of a way to make the NML compilers use NFO7, other than to use an older compiler that only supports NFO7.

Could it be possible for the compiler to either check if NFO8 features are being used, and if they are not, automatically revert to NFO7? Or, is there a possibility that the authors can set a flag to force the usage of NFO7 if they know they're not using NFO8 features?
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Have NML compilers default to NFO7?

Post by planetmaker »

kamnet wrote: Could it be possible for the compiler to either check if NFO8 features are being used, and if they are not, automatically revert to NFO7? Or, is there a possibility that the authors can set a flag to force the usage of NFO7 if they know they're not using NFO8 features?
That involves an effort in compiler (=nmlc) writing which by no means is justified by the gain.

It would be WAY less work to update every existing patchpack.
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: Have NML compilers default to NFO7?

Post by Rubidium »

It's possible, but highly unlikely to be ever implemented given the amount of effort it takes to implement and maintain such an option.

Also, it might very well be that the NewGRF doesn't use NFO8, however uses features that were introduced after NFO8. At that moment the resulting NewGRF doesn't work with OpenTTD versions that only support NFO7, and thus there is no harm in using NFO8.
Supercheese
Tycoon
Tycoon
Posts: 1660
Joined: 16 Dec 2007 22:24
Location: Idaho, USA

Re: Have NML compilers default to NFO7?

Post by Supercheese »

It's easier for the author to identify whether there are any features that require nightly NML versions (and GRFv8), and if not, to compile using NML 0.2.3, rather than trying to code NML to identify for you.

Although NML 0.2.3 will probably complain if you try to compile something that uses GRFv8 features, so in a sense that'd be a way of telling.
Last edited by Supercheese on 14 Sep 2012 16:06, edited 1 time in total.
Eyecandy Road Vehicles | Fake Subways | Supercheese's NewObjects

"Fashions and cultures change, but steam trains shall always be majestic."
-Professor Hershel Layton
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Have NML compilers default to NFO7?

Post by planetmaker »

Supercheese wrote:It's easier for the author to identify whether there are any features that require nightly NML versions (and thus GRFv8), and if not, to compile using NML 0.2.3, rather than trying to code NML to identify for you.
It's not exactly that easy. You'll have to re-write some parts. See the list of changes
Supercheese
Tycoon
Tycoon
Posts: 1660
Joined: 16 Dec 2007 22:24
Location: Idaho, USA

Re: Have NML compilers default to NFO7?

Post by Supercheese »

planetmaker wrote:It's not exactly that easy. You'll have to re-write some parts. See the list of changes
Yes, but surely it is easier than trying to make NML do it for you, no?
Eyecandy Road Vehicles | Fake Subways | Supercheese's NewObjects

"Fashions and cultures change, but steam trains shall always be majestic."
-Professor Hershel Layton
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Have NML compilers default to NFO7?

Post by planetmaker »

Supercheese wrote:
planetmaker wrote:It's not exactly that easy. You'll have to re-write some parts. See the list of changes
Yes, but surely it is easier than trying to make NML do it for you, no?
Oh, now I get what you said :-) That surely is easier, yes!

Personally I'd estimate the needed effort to make NML decide automatically nfov7+container format 1 vs. nfo v8+container format 2 to be of the order of one to two years work - given the current not-so-slow rate of work on NML. And I'd rather see station and bridge support instead. Requiring a manual switch might make it easier, but still would bloat the code dramatically, slowing down every future development tremendously
Hirundo
Transport Coordinator
Transport Coordinator
Posts: 298
Joined: 27 Jan 2008 13:02

Re: Have NML compilers default to NFO7?

Post by Hirundo »

Support for nfov7/grfv1 might (or might not) be re-added in the future. As I don't expect lots of further changes to grf-outputting section in NML, the extra overhead of maintaining two versions of the output format should be manageable. But, as planetmaker said, the time spent adding nfov7 support cannot also be spent adding station/bridge support. Take your pick :)

As a work-around, you might want to try to let NML output nfo and use grfcodec to encode that (v32) nfo into a GRF container version 1 NewGRF.
Create your own NewGRF? Check out this tutorial!
Supercheese
Tycoon
Tycoon
Posts: 1660
Joined: 16 Dec 2007 22:24
Location: Idaho, USA

Re: Have NML compilers default to NFO7?

Post by Supercheese »

FooBar wrote:Station/bridge, please :)
Yes indeed (and personally, stations more than bridges :wink: ).
Eyecandy Road Vehicles | Fake Subways | Supercheese's NewObjects

"Fashions and cultures change, but steam trains shall always be majestic."
-Professor Hershel Layton
Hirundo
Transport Coordinator
Transport Coordinator
Posts: 298
Joined: 27 Jan 2008 13:02

Re: Have NML compilers default to NFO7?

Post by Hirundo »

Supercheese wrote:
FooBar wrote:Station/bridge, please :)
Yes indeed (and personally, stations more than bridges :wink: ).
First steps...
Still a looong way to go, though. I'd estimate that with these commits it's just 5-10% done.
Create your own NewGRF? Check out this tutorial!
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 13 guests