NFORenum 4.0.0

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

Moderator: Graphics Moderators

Post Reply
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

NFORenum 4.0.0

Post by Rubidium »

Note: NFORenum has been merged with the GRFCodec source package. As such new downloads can be found at the GRFCodec thread.
The information below is therefore of a historical nature.



Due to time constraints and loss of interest DaleStan could not work on GRFCodec and NFORenum anymore. This resulted in the slow decay of both GRFCodec and NFORenum.

This caused problems for people compiling it with recent compilers (it failed to compile), for the developement of the NewGRF specifications (new features wouldn't be supported) or for the people, such as the nice folks at OpenTTDcoop's developer zone, for using it to develop NewGRFs; many warnings about valid NFO, but just because NFORenum hasn't been updated.

With the release of NFORenum 4.0.0 we revive NFORenum in the hope to keep it useful and usable for as long as it's neeeded. In any case some things regarding the development have changed. The source repository and issue tracker can be found on http://dev.openttdcoop.org/projects/nforenum and as such bug reports and feature requests for NFORenum should go to there. Furthermore we will try to release at least two stable version of NFORenum per year, or more often if required.

Issues with NFORenum or feature requests can go here to determine whether it is actually a bug or whether the feature request is feasible, but ultimately we would like them to be reported at the tracker.

In any case, we would like to thank DaleStan for initially developing and maintaining NFORenum.
Last edited by Rubidium on 17 Oct 2010 21:05, edited 2 times in total.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: NFORenum 4.0.0-RC1

Post by wallyweb »

This as well shall be given a good workout over the next few weeks. :D
Thank you for your work on this.
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1675
Joined: 04 Mar 2005 01:07

Re: NFORenum 4.0.0-RC1

Post by OzTrans »

A couple of issues not showing with previous version of NfoRenum :

Code: Select all

//!!Warning (86): Offset 4: Testing nonexistant variable 25.
1376 * 30	 02 00 00 89 25 20 FF FF FF FF ... 

Code: Select all

//!!Error (162): Offset 14: Text ID DC01 has not been defined.
//!!Error (162): Offset 17: Text ID DC02 has not been defined.
3988 * 57	 00 0B 13 01 16 08 16 09 00 DC 0A 00 DC 0B 01 DC 0C 02 DC
                                                 0D 03 DC 0E DA 10 0F 10 10 07 11 FF 12 ...
surely defined; funny it doesn't complain about DC00 and DC03
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: NFORenum 4.0.0-RC1

Post by Rubidium »

OzTrans wrote:A couple of issues not showing with previous version of NfoRenum :

Code: Select all

//!!Warning (86): Offset 4: Testing nonexistant variable 25.
NFORenum (nightly) r2309 had the same complaint; probably you had a custom .dat file. In any case, thanks for the report and it's fixed in NFORenum r463.

OzTrans wrote:

Code: Select all

//!!Error (162): Offset 14: Text ID DC01 has not been defined.
//!!Error (162): Offset 17: Text ID DC02 has not been defined.
For this I need a larger testcase, preferably the whole .nfo that is causing the problem (you can PM me the .nfo as well).
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1675
Joined: 04 Mar 2005 01:07

Re: NFORenum 4.0.0-RC1

Post by OzTrans »

//!!Error (162): Offset 14: Text ID DC01 has not been defined.
This should help ... When NfoRenum passes the action 4's, it takes a note of the first and last string ID with multiple string definitions. DC00 through to DC03 were defined together in one action-4; that's why it didn't complain about DC00 and DC03.
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: NFORenum 4.0.0-RC1

Post by Rubidium »

OzTrans wrote:This should help ...
Yes it did; could create a testcase and fix it (in r464).
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1675
Joined: 04 Mar 2005 01:07

Re: NFORenum 4.0.0

Post by OzTrans »

Here is another one, deteced mistakenly by r465 ... it is valid for feature 0F (objects).

Code: Select all

//!!Warning (86): Offset 4: Testing nonexistant variable 5F.
 5670 * 111	 02 0F 20 85 5F 2C 0F 00 00 43 20 0F 00 ...
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: NFORenum 4.0.0

Post by Rubidium »

OzTrans wrote:

Code: Select all

//!!Warning (86): Offset 4: Testing nonexistant variable 5F.
Fixed in r470.
User avatar
Gremnon
Tycoon
Tycoon
Posts: 1517
Joined: 16 Sep 2005 12:23
Skype: the_gremnon
Location: /home
Contact:

Re: NFORenum 4.0.0

Post by Gremnon »

For those using Arch Linux, there are now packages in the AUR to install NFORenum, maintained by me.
You can find it here: http://aur.archlinux.org/packages.php?ID=40248
User avatar
Froix
Engineer
Engineer
Posts: 65
Joined: 16 Jul 2010 13:09

Re: NFORenum 4.0.0

Post by Froix »

Excellent work sirs!
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: NFORenum 4.0.0

Post by wallyweb »

Rubidium wrote:Fixed in r470.
The changelog is still at r469. Has the download gone to r470 without an update to the changelog?
Ooops! :oops: I was looking at the release and not the nightly. All is well.
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: NFORenum 4.0.0

Post by Lakie »

Unless I'm mistaken object property 15 should be a word value. (using r482)

Code: Select all

//!!Fatal Error (47): Offset 16: Invalid property 00.
    3 * 19	 00 0F 06 01 04
		  11  FF FF
		  12  02
		  13  03
		  14  0A
		  15  31 00
		  16  01
I'm not really sure what's wrong here, the older versions of Renum never complained about this. (using r482)

Code: Select all

//!!Warning (209): Offset 4: Found byte 1 of a 4-byte escape while reading byte 1 of a 1-byte field.
    7 * 17     02 0F 00
          00        // Number of sprites
          \d3924    // Ground Sprite
          00 80 00 80   00 00    00 00 00
~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: NFORenum 4.0.0

Post by Rubidium »

Lakie wrote:Unless I'm mistaken object property 15 should be a word value. (using r482)

Code: Select all

//!!Fatal Error (47): Offset 16: Invalid property 00.
    3 * 19	 00 0F 06 01 04
		  11  FF FF
		  12  02
		  13  03
		  14  0A
		  15  31 00
		  16  01
13 is a word. So 0A is interpreted as property, which is a word as well so 00 gets interpreted as a property. So the error is not property 15.

Testing this with (svn) r2309 reproduces the issue, so it's not recently introduced. Nevertheless it's fixed in r484.
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: NFORenum 4.0.0

Post by Eddi »

Lakie wrote: I'm not really sure what's wrong here, the older versions of Renum never complained about this. (using r482)

Code: Select all

//!!Warning (209): Offset 4: Found byte 1 of a 4-byte escape while reading byte 1 of a 1-byte field.
    7 * 17     02 0F 00
          00        // Number of sprites
          \d3924    // Ground Sprite
          00 80 00 80   00 00    00 00 00
the point of warnings is not usually to say something is wrong, but more point out common pitfalls, in this situation it looks like you have an alignment problem, because the 4-byte-escape is distributed over several syntax elements after expanding. this means that you might have forgotten a byte somewhere or so.
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: NFORenum 4.0.0

Post by FooBar »

Eddi wrote:the point of warnings is not usually to say something is wrong, but more point out common pitfalls
If there's nothing wrong, there shouldn't be warned. When I allowed this warning in FIRS, it filled my terminal to the point where the warnings didn't even fit into it any more[0]. Now that's not useful if you're looking for real bugs.
Apart from that, Lakie's code looks perfectly fine and the escape doesn't span multiple elements in this case.



[0]Why this wasn't reported earlier is a bit of a mystery. This particular warning has been disabled in FIRS for about a year, so there's no point arguing why we didn't report it back then: we have no idea. Anyways, it's fixed now.
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1675
Joined: 04 Mar 2005 01:07

Re: NFORenum 4.0.0

Post by OzTrans »

Digging deep ... digging even deeper ... well, here we are ...

The last time NFORenum was updated was v6.0.5 [dated 9 May 2015]; now is about high time to give NFORenum a facelift.

Here is a list of things to be fixed :

Code: Select all

Feature 07 [houses] :

//!!Error (203): Offset 10: No persistent registers exist for this feature.
  499 * 30	 02 07 00 8A 1A 20 01 00 00 00 10 1A 00 09 00 00 00 ...

//!!Warning (86): Offset 4: Testing nonexistant variable 7C.
  500 * 15	 02 07 50 82 7C 09 00 FF 01 50 00 01 01 00 00

//!!Warning (103): Offset 6: Shifting variable 47 past its length.
  528 * 23	 02 07 09 89 47 10 FF FF 00 00 ...

Feature 0D [airports] :

Action 03, IDs are valid 0x00..0x10 and probably beyond that.
//!!Error (141): ID 03 out of valid range (00..00).
  132 * 7	 00 0D 01 01 03 08 FF
//!!Error (141): ID 08 out of valid range (00..00).
  133 * 7	 00 0D 01 01 08 08 FF

Feature 11 [airport tiles] :

//!!Warning (163): Offset 11: Checking for var0C in the range [52 01,53 01]. [nothing wrong with that]
 2167 * 17	 02 11 60 85 0C 00 FF FF 01 01 00 52 01 53 01 A0 00

Feature 0D [airports] :

//!!Warning (86): Offset 4: Testing nonexistant variable 40.
 2339 * 22	 02 0D 09 81 40 00 03 03 05 00 01 01 06 00 02 02 07 00 03 03 04 00

Feature 0F [objects] :

//!!Warning (189): Offset 5: ID FA is defined with feature 11. [calling a procedure of a different feature is not an error]
 3057 * 15	 02 0F D0 81 7E FA 00 FF 01 D0 00 01 01 FF 00

Feature 10 [railtypes] :

Action 03, Cargo Type 0B
//!!Error (57): Offset 29: Invalid cargo type: 0B
 4927 * 34	 03 10 01 08 09 00 A3 00 01 A8 00 02 AB 00 03 AE 00 06 E1 00 08 B7 00 09 BA 00 0A BB 00 0B BD 00 FF 00

Action 05 :

//!!Warning (61): Loading sprites 0xC0..0xEF into an array with only 0x30 entries.
 2075 * 8	 05 84 FF C0 00 FF 30 00

//!!Warning (61): Loading sprites 0x4..0xB2 into an array with only 0xAF entries.
 2879 * 8	 05 95 FF 04 00 FF AF 00

Feature 12 [roadtypes]
[missing altogether]

Feature 13 [tramtypes]
[missing altogether]

Feature ?? [roadstops]
[missing altogether]


The following are not errors as far as OpenTTD [vanilla] is concerned, but are features in JGR-PP :

[add a command-line option for checking for / not reporting on JGR-PP errors]

Feature 06 [bridges] :

Action 00, Property 14
//!!Fatal Error (47): Offset 5: Invalid property 14.
 7237 * 58	 00 06 01 0D 00 14 23 0A 00 00 26 0A 00 00 ...

Action 00, ID 0D .. 0F
//!!Error (141): ID 0D out of valid range (00..0C).
 9470 * 904	 00 06 01 01 0D 0D 00 07 F2 00 00 00 00 00 00 00 ...

For starters :

Add an Action-14 check for 'FIDM' and treat defined features as valid.
    9 * 41       14 "C" "FIDM" "T" "NAME" 00 "road_stops" 00 "B" "FTID" 01 00 60 "B" "SETT" 01 00 10 00 00

There are most likely more errors and warnings that are not, I just haven't encountered them yet.
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: NFORenum 4.0.0

Post by Michi_cc »

Current home of NFORenum is at https://github.com/OpenTTD/grfcodec.

Pull requests containing fixes or new features are accepted. Unfortunately AI has not achieved sentience yet so it still requires human work from Somebody™.
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 0 guests