Gary L. Simmons  rev 08/19/03  http://battlecatslitterbox.com/Anvil/HAS/Images.html
Litterbox  Anvil Tips  Hamish Sanderson's EditNotes


The Battle Cat's Litterbox


Anvil Tips | HAS Tutorials | Edit Notes | Sounds & Music | Images File | Tools | Nonstandard Colors | Control Modifications | HUD Modifications | Prefs Modifications | PICT Notes | Engine Hacking | Documentation | Bandwidth Saving | Unused Sounds | Hakvil | Shapes 1 | Shapes 2 | Color Clippings | Custom Icons | Clut Notes


The Images File


Hamish Sanderson has his image to live up to, and Marathon has it's images file to live up to. I think they are both doing a damn fine job. In todays tutorial HAS explains the inner workings of the Images file and how to tweak them mercilessly. In retaliation the Images file explains the inner workings of Hamish and how to tweak THEM mercilessly. Special attention is given to his duodenum (gad, I hope that's his duodenum!), pleura, and other miscellaneous viscera. Much time is spent clearing up the confusion often associated with comparing just any old bag of guts to a fine plate of haggis. You don't want to miss this one. gls


Basic

The Images file can be edited using ResEdit. All its contents are to be found in the Resource fork of the file; the Data fork is empty. Open it in ResEdit to see the following:

PICT resources
CLUT resources

The Images file contains the Splash screen (appears when you run the Marathon Infinity app), Main Controls screen (2 of - an 'off' version and an 'on' version), Credits screens (2 of, which appear sequentially), in-game HUD (background image only - all the 'active' elements are held in the Shapes file).

In the original Marathon Infinity Images file, all of the above are present in three flavors (excepting the HUD, which is only available in two): 256 colors (8-bit), thousands of colors (16-bit) and millions of colors (24-bit). [Space saver note: This results in a file 4.5Mb in size!]

Also present in the Images file is a number of CLUT resources; these are the CLUTs required for the 8-bit PICTs to display correctly when viewed in 256 colors.

The remainder of this topic discusses Splash screens, Main Controls and Credits, but ignores the HUDs as these are a slightly different issue.

Format

PICTs viewed at 256 colors are numbered 1xxx
PICTs viewed at 1000s colors are numbered 2xxx
PICTs viewed at millions colors are numbered 3xxx

What this means is that PICTs labeled 1xxx display when the monitor is set to 256 colors, those labeled 2xxx display when it's set to 1000s colors, etc. QuickDraw doesn't care about the actual color depth of the PICTs themselves; it will simply draw whatever is available as best it can depending on monitor depth. Normally, you would expect the 1xxx PICTs to be 8-bit, 2xxx PICTs to be 16-bit, etc. This allows the artist to produce artwork that is best optimized for each of these color depths. However, it doesn't mean that you _must_ place only 8-bit artwork in the 1xxx slots, 16-bit in the 2xxx slots, etc. You could, for example, place 24-bit artwork in the 1xxx slots and have nothing in the 3xxx slots (but more on this, and where it might be useful, later).

PICTs may be of any size, given a few provisos; it is not necessary that they remain the same size as the original Marathon ones, for example. The maximum size is 640x480 (for obvious reasons - this is the monitor resolution used by Marathon Infinity). Smaller PICTs will appear centered in the screen, surrounded by background color (see footnote ?). The smallest size for the Main Controls screen is determined by the placement of the buttons; obviously you don't want the buttons to lie outside of the PICT!

The following slots are the ones that _must_ be filled for the Images file to function correctly:

1100 (Main Controls "off")
1101 (Main Controls "on")
1700 (HUD background)

The remaining 1xxx slots are all effectively optional; the Marathon Infinity engine does not require you to include a splash screen (on running the app it will simply go straight to the Main Controls screen, which has the advantage inasmuch as it lets the player get on with the serious business of actually playing the game!:). The engine does not actually require the presence of any Credits screens either; however, Bungie themselves would probably object to their Credits being removed on legal grounds. If you do intend to modify Credits screens, I would suggest looking towards the Tempus Irae/Evil model where one new screen is inserted for scenario credits whilst the original Marathon Infinity Creators screen is left intact. In any case, I would recommend checking with Bungie before making any changes to the contents of the Credits screens.

All 2xxx and 3xxx slots are 100% optional - you may, if you wish, fill none of these, or some, or all. Where the engine does not encounter a 2xxx PICT, for example, it will simply look for the equivalent PICT with a 1xxx ID.

Adding new Artwork

Anyway, as far as inserting new artwork goes, it's a simple matter of copying and pasting via ResEdit.

8-bit:
Remember that 8-bit PICTs require the addition of a separate CLUT resource (using same ID as the corresponding PICT). These may be generated from Photoshop CLUTs using the Photoshop CLUT Converter application. [Check: Graphic Converter can also output CLUTs as resources?] Note that when indexing the Main Controls screens ('off' and 'on' versions), these _must_ share a common CLUT (since both, or rather parts of both, will be visible simultaneously). The easiest way to do this is to paste both into a single document and then index that, before exporting the CLUT and copying out the relevant bits.

16-bit:
In Photoshop, 16-bit artwork can be generated by saving a copy of the image as a PICT at 16-bit depth. When you re-open the file, it will contain a 16-bit PICT. [Any Graphic Converter info on this?]

In deciding _where_ you are going to put new artwork, consider the following:

The original Marathon Infinity Images file weighs in at a hefty 4.6Mb (2.9Mb Stuffed). A stripped down version containing only 1xxx PICTs containing 8-bit artwork is a mere 943Kb (674Kb Stuffed) by comparison. Bear in mind that a 16-bit image contains approximately. twice as much data as an equivalent 8-bit version, and a 24-bit image contains three times as much data as the 8-bit version. ie. 24-bit PICTs are pretty big!

However, there is usually some tradeoff here; the 8-bit art doesn't look quite as good in millions of colors as the 24-bit artwork does, for example. As for how 8-bit or 24-bit artwork looks when viewed in 1000s colors, well, go see the specific notes on 16-bit PICTs. The PICTs in Bungie's Images file sensibly stick to a quite limited range of colors - apart from the aesthetic advantages this has the added benefit that it make it relatively easy to generate a good-looking 8-bit PICT as you don't have to cover too much of a color range within the available 256 colors available in the CLUT. A multi-hued PICT, on the other hand, will probably look much less smooth.

Space saver Notes

Here is what I would recommend as being the best balance to strike between size and quality:

Fill all the 1xxx slots with 8-bit artwork. (Including Splash screen, if you have one).
Fill all the 2xxx slots with either 16-bit or 24-bit versions of the artwork <see PICT format notes>.
Remove all 3xxx PICTs.

If your 8-bit artwork is of particularly good quality, then consider removing all the 2xxx PICTs too for an especially compact Images file that looks as good (or almost) as good in 1000s or millions of colors as it would if it had had the extra 3-4Mb of artwork in it! Or you may compromise on the 2xxx slots by adding artwork only to the most important slots (e.g. Main Controls, HUD) and leaving non-essential ones (e.g. the Credits screen[s]) with only 1xxx artwork. In any case, this is one you should play by ear, depending on exactly what sort of artwork it is that you're using.

[A further alternative is that you could, in theory, place 24-bit artwork into the 8-bit slots, having prepared 'suitable' CLUTs for addition to the CLUT resource (by indexing a copy of the 24-bit artwork, then exporting the CLUT for use before throwing the indexed art away again). This method would effectively leave the whole 'quality of presentation' thing for QuickDraw to sort out. However, this is something of a hit-or-miss approach in practice, as the result usually doesn't look as good as artwork that has been carefully prepared and optimized by the artist.]

<Please check the notes on PICT formats for information on how best to prepare your PICT artwork. [includes notes on PICT compression formats]> (Editors Note: the PICT notes is coming next - gls 09/23/2000)

An additional method for shaving a bit extra off the Images file size is as follows:

In the 1101/2101/3101 PICTs (Main Controls "on"), you can remove all the detailing from all areas of the image that lie outside of the 'buttons' (specifically, the rectangles that are the clickable areas) since none of this artwork will ever be seen. A flat continuous tone always compresses much more efficiently than detailed artwork, as can be seen in the example below:

Main Controls

As you can see, this may make a marked difference to that PICT's size (now one-third of original size).

HUD artwork notes

HUD artwork is a slightly different issue to the rest of the Images artwork. Whereas all the other 1xxx artwork can use optimized CLUTs, the 8-bit HUD [1700] should stick to the existing Marathon Infinity in-game CLUT only. i.e. Use the Marathon Infinity CLUT to index the HUD artwork here; don't create a custom/adaptive CLUT as it won't do any good. You do not need to add an ID 1700 CLUT to the Images file, btw.

The 16-bit HUD artwork [2700] doesn't have quite the same limitation on it; however, you'd be well advised to keep your colors close to the Marathon Infinity CLUT, taking advantage of the greater bit-depth to produce a smoother-looking version of the HUD rather than going for something that's all-out different.

Footnotes

Remember that all Images artwork _except_ the 1xxx HUD can use any colors you like. However, choose your color schemes sensibly, bearing in mind the limitations of the different color depths that folks will run the game at.

When poking around the original Marathon Infinity Images file, note how it's a less than efficient build, e.g. the 2100 PICT is 24-bit (instead of 16-bit, which would be smaller, and could have been better optimized for viewing at 1000s colors), and the 3400 and 3401 PICTs are both just 16-bit again (in which case they could simply have been cut). Nor is the improvement in quality of the 3xxx art over the 2xxx and/or 1xxx art all that noticeable, so it's a moot point on whether having so many PICTs is really worth it considering the significantly increased file size.



Anvil Tips | HAS Tutorials | Edit Notes | Sounds & Music | Images File | Tools | Nonstandard Colors | Control Modifications | HUD Modifications | Prefs Modifications | PICT Notes | Engine Hacking | Documentation | Bandwidth Saving | Unused Sounds | Hakvil | Shapes 1 | Shapes 2 | Color Clippings | Custom Icons | Clut Notes

Top of page

Back to the Litterbox