I used to play TTD a lot many years ago, and was very happy to find OpenTTD. I haven't really played with it much yet, but have become fascinated in particular by the development of NewGRFs. The specification seems mind-bogglingly Byzantine, and my hat is off to everyone who is writing GRFs, especially in NFO. NML is a very worthwhile project, but I understand it currently has limited support for the many features of the spec. I found quite it difficult to map the NML back to the NFO.
Anyway, the point of posting is that I have written a viewer which reads a GRF file and allows the user to browse its contents. Each record (i.e. sprite or pseudo-sprite) is represented as a treeview of fields. This was a lot easier than trying to develop specific dialogs for each type (and special subtype) of action or property. Each field is, where possible, given a description which I cribbed from the wiki (feature names, industry names, property descriptions, and so on). I guess I've reproduced Grf2Html somewhat...
The program can in theory read any Version 7 GRF, but there are bound to be bugs like reading a word instead of an extended byte, or where I've overlooked some detail in the spec. And there are one or two as yet undocumented areas. I've also found one or two broken GRFs, which OTTD also rejected. It will pick up the palette and version from Action 14 and Action 8, if these are present, but you can swap at any time. The software currently only distinguishes GRF7 from earlier versions (referred to as GRF6), and this information is only used when creating a description for a language.
I would be very interested in feedback on whether this is actually a useful tool, and what direction it might take. I have some ideas about how to turn it into an in-place editor, but this is not a small task. For now, I think I've split out the information too finely in some cases, and want to review all the fields for a consistent presentation, and to combine multiple treeitems where it makes sense to do so (properties are prime candidates). I would also like to beef up the properties to split out bitfields, show enumeration names, use appropriate number formatting, and show units. It is also likely that I have missed some important relationships between records.
The program is developed using Qt4, so should in principle build for Linux as easily as for Windows, though I have not looked into this yet. The consequence is that the GUI framework requires one or two large redistributable DLLs, making the program a 12Mb download. I didn't feel comfortable posting that here, but would it be OK? Or should I set up some hosting on SourceForge or something? I'm working on Windows 7 and have no idea if the executable will work on earlier versions. Screen dumps attached.
newgrfviewer2.png [83.6 KiB]
Downloaded 1 time
newgrfviewer.png [108.47 KiB]
Downloaded 1 time