.rez Format

Greetings, all!

Plug-in development (and writing a plug-in editor) for the Macintosh is relatively easy, since the structure of a Mac file's resource fork can be read and parsed by MacOS-specific APIs. It's a little harder on Windows, since the entire .rez file is a single data stream. To date, there is only one widely available plug-in editor for Windows (EVNEW).

I'm planning to add to the EVN Developer's toolkit by writing a Java application that will parse and write .rez files. However, while the EV Bible details the format of a resource-fork-based plug-in, I have been unable to locate documentation for the .rez file format.

Specifically, it would be helpful to know the byte-by-byte "syntax" for resource fields, as well as how the fields are laid out in the file. A formal grammar would help as well.

If anyone at Ambrosia, ATMOS, or Contraband could publish a "Rosetta Stone" type document detailing the process of encoding EVN structures in .rez, it would be greatly appreciated. The source code for the Mac-to-.rez converter might contain some clues to the .rez format, although it is presently a "black box".

Cheers!

-NightMoon
furrystarcat@yahoo.com

Partial: http://www.ambrosiasw.com/forums/index.php...ndpost&p;=233828

Good luck.

Though I can't help thinking using C++ and releasing a dll (with your parser using the dll) would be more useful, reducing the obstacle of .rez for future progammers.

@nightmoon, on Apr 19 2006, 09:21 AM, said in .rez Format:

<snip>

I know I'd find that quite useful. Good luck!

and to think, all i had to do was ask... oh well, figuring it out for myself was good practice or built character or something, right?

Though Mission Computer is Mac only, it is capable of creating and modifying .rez files. Maybe looking into that might help you some?

Well NightMoon, as a progammer involved in a (Mac) plug-in editor, I wish you the best of luck in this project. The stuff posted by Mehrunes is indeed the most solid information we have on the .rez format, and it allowed EVNEW and two .rez-to-Mac plug-in convertors. As it happens the source code for the .rez-to-Mac converter is available at http://www.burgerbec...lib.html#evnova but I don't know how much is hidden in BurgerLib and how much is in the availble source.

Also, you might wish to check, for inspiration, the Mac resource file format, it's obvious rez is inspired from it.

Now that only covers the .rez wrapper format, what is the format of the individual resources, for instance, what is the format of shďp, chär or röid? It is the same as on the Mac. So the better way to know the format is to get the ResEdit templates (in the Mac Nova distribution, by using Stuffit you can get it) and interpret them; the format of the templates, in turn, is a stream of:
- pascal string (a length byte followed by the characters, as many chars as is indicated in the length byte) containing the field label for edition
- a four-char-code indicating which kind of data, they are documented in ResEdit Reference, or Rezilla documentation if you don't feel like downloading the pdf; for instance DWRD means a 2-byte (16 bits) value (usualy referred to as a short) represented as a signed decimal integer (it is the single most often used field format in Nova resources).
Repeat for the number fo times necessary to parse the chole TMPL resource.

Notice the Bible, when referring to the various fields, uses the template labels, so by using the Bible and the templates together you have full documentation of the Nova-specific resources.

Lastly, you might wish to know the format of some resources, say 'STR ', 'STR#', 'PICT' (better let QuickTime handle that one), 'snd ', but also, it could be useful, 'ppat', 'cicn', 'DITL', etc... These are still the same as on the Mac, and they are not specific to Nova so they are not covered by the Bible/Nova templates. Most of them are documented in Apple's old developer documentation (nowadays in the OSX era, and especially as we've entered the Intel era, they tend to hide it since it is pre-Carbon documentation, but you can find it if you look hard enough in develooper.apple.com). 'rlë8' and 'rlëD' are not Apple resources but they are not Nova-specific either (they come from SpriteWorld), and what is know about them, with sample code, can be found in this topic (the latest version of ViewRLE code can be found with the app at the add-on files); you'd better use Bryce's code for decoding rles as mine is optimised to death and is less readable, save you should fix the bug towards the end with kSingleColorToken and rlëD, where the count is the count of bytes and not pixels. Of course you can also check out the EVNEW source code (which also handles encoding rles) at http://www.geocities.com/aprosenf/.

I think that's most of the stuff you need to make an editor. Now good luck!

This post has been edited by Zacha Pedro : 19 April 2006 - 04:14 PM

Wow! Thanks for all the information! With this, it might very well be possible to create a Java utility that will not only handle .rez files, but .rsrc files as well! This could lead to a cross-platform editor/converter. Even better, it might not be restricted to handling Nova resources, but could become a cross-platform "Resource Manager"-like API and extensible "ResEdit"-like program! Wish me luck, guys!

-NightMoon

Quote

Wish me luck, guys!

Well, good luck then!

I certainly would love to see another plug-in making tool than EVNEW for PC. While it does an okay job, it lacks a couple of tools that could make one's job that much faster and easier.