Firstly, I'm sorry for writing an essay...
You may recall that last year I wrote NewGRF Viewer. That was basically a GUI dump of the contents of a NewGRF file. Wallyweb was kind enough to have a play with it. I made some efforts towards turning it into an editor but found that my basic UI design was unworkable for this purpose, and I abandoned the project. I restarted a couple of months ago, and have written NewGRF Editor. I hope some may find it useful.
- Graphical user interface for NFO
- Complete(ish) representation of the GRF8 specification
- Writes directly to GRFs
- Reads existing GRFs
- GRFs can be exported as NFO - for testing against grfcodec (no escapes)
- Sprites can be exported as a PNG sprite sheet
- Sprites can be re-imported after modification
- Unicode strings
- String control codes in human readable format
- Currently only GRF container format 1
Some notes and caveats:
This is not a graphical NML tool. I really like the idea of a visual NML, but this would almost certainly preclude modifying existing GRFs, which was a key goal.
Though I have attempted to address every aspect of the specification, there are almost certainly some things I overlooked, forgot, didn't understand well enough, or implemented incorrectly. One or two things are not documented (e.g. advanced station layouts). There are some loose ends, and probably/definitely bugs, too. Action00 properties are stored in numerical order and can only appear once per action, which is more limited than the spec. I have one or two mitigations in mind, if necessary.
Users of GRFMaker should be more or less at home with the software, and there are a few places where the design is very clearly influenced by GRFMaker. Some of the custom controls for editing values need a little work, but they are functional. I'm quite happy with some bits of the UI, others not so much.
There is no image editing capability. People far cleverer than me have spent years developing any number of amazing tools for this purpose. The editor can import and export 8-bit PNG images, and maintains metadata so that they can be re-imported after subsequent editing. The palettes in the images are ignored.
I have no real experience in actually creating GRFs, so the UI might not always be the most sensible design for an experienced coder. I have tweaked a few, and OTTD seemed to like them. I have endeavoured to make all the data relatively simple to get at, but some of the data structures are rather involved. There might be simplifications or improvements which would not compromise supporting the whole specification. Aside from the coding aspect, I couldn't draw to save my life.
Cargos are a bit odd. There is a global table that is used if there is no cargo translation table in the GRF. I assumed at most one such table will be defined, and this allows me to toggle the global table on/off as necessary. Having two alternate translation tables would mess that up. Reading older GRFs will work, but there is sure to be some weirdness where old style cargo slots have been used.
Testing thus far has mostly comprised reading existing GRFs and knocking up dummy GRFs as I went through each pseudosprite. This does not amount to complete coverage of all possibilities. A *lot* more work is needed to confirm that the binary output is correct in all cases. I think the software is useable, but it's an alpha. There definitely needs to be more validation to avoid illegal or inconsistent GRFs (Action14s in the wrong place, more than one Action08, etc).
The project was developed in C++ using Qt4, and I'm releasing it under GPL3. I did all the development under Windows, but getting it running under Linux should in theory be straightforward. The source has some features that do not fill me with professional pride, but refactoring can wait. I would prefer a static release build, but it seems this is only allowed under Qt's commercial licence. It's a bit of a faff with Qt, to be honest.
Anyway, I think the software has now reached the point where it would really benefit from some feedback and bug reports. I had hoped to deliver something more polished, but I'm running out of steam.
If you are interested, please take a look in my dropbox (https://www.dropbox.com/sh/7te6csl7pxmalgf/K4lgj-iPTX
). You'll need the Qt DLLs, and might have to run the MS redistributable installer. I think that's everything, but it's hard to be certain if you don't have a pristine machine to try it out on.
Only an egg