MC2S Utility Site


CivSprite Readme

CivSprite 1.0 by Mercator

Last Changed: 9 December 2002

Introduction

CivSprite is a fairly simple converter for Civilization II: Test of Time sprite files. With this program you can export the images contained in such sprite files to bitmaps, and import them again into existing sprite files.

For those of you with a short attention span... If you don't wish to read all of this file, read at least the last two sections about masks and animations!

Installation

You've obviously found a way to extract the archive, since you're reading this. You should have found 2 files:

Installation is trivial, just put these two files anywhere you please and run the program.

If you get any error messages involving certain files called COMDLG32.OCX or MSCOMCTL.OCX, install MapEdit, use Google.com to locate a copy, or send me some hate mail to let me know how stupid I am for not putting these files up on my website (if there are enough of those, you might just convince me).

For any other error messages, install the Visual Basic 6 Run Time Files available on my website.

If the above 2 don't solve the problem, contact me.

Exporting

Before you can export any images from a sprite file, you must specify 2 things:

The Export button will be enabled as soon as both text boxes contain valid paths. If the bitmap folder doesn't exist, you will be asked if you want to create it.

Each sprite will be exported as a pair of 2 bitmaps. One ends in .img.bmp and contains the "real" image. The other (with the same file name) ends in .msk.bmp and contains a "mask" (more about that later). So, each image from a sprite file will be exported as follows:

SpriteFile-NNN.img.bmp
SpriteFile-NNN.msk.bmp

SpriteFile is the same as the name of the sprite file you exported the images from. NNN is a 3 digit number corresponding to the place of the image inside the sprite file.

If you cancel the process, no more bitmaps will be created (the ones already exported will remain).

Importing

As with exporting, you need to specify the sprite file and the bitmap folder. But in this case, the bitmap folder must already exist (or there would be nothing to import).

The names of the bitmaps to be imported must match with the name of the sprite file. The 3 digit number in the filename will determine where in the sprite file the image will end up.

A backup of the original sprite file will be made (.bak is appended). If such a backup already exists, you may overwrite it, continue without making a backup, or cancel altogether.

If you cancel the importing process, nothing will be changed.

Masks

As said earlier, each image is exported as 2 images, one "real" image, the other a "mask". So what is this mask?

You can see the separate mask bitmap as representing an extra property of the pixels in the other exported bitmap. More specifically, it determines whether that pixel should be painted in the owning civilization shade.

Any non-black pixel in the mask will turn the corresponding pixel in the image into the shade of the owning civilization. That is, in Civilization II, once you've imported the image back into the sprite file.

Even though some resource animations also have masks, those don't seem to have any effect.

In any case, if a mask image is entirely black, you may delete it.

Animations

This section describes the main limitation of this simple conversion tool: animation properties can not be altered.

Both the Resource.spr and UnitXX.spr files contain animations. The former for the resources, the latter for the units.

Sprite files use a very space efficient, but not quite straight-forward method to store animations. Because of that, the exported images need not be in animation order.

Single frames, as well as animations, can be reused, mirrored, faded etc.

None of those properties, however, can be edited using CivSprite. You can edit the images individually, of course, but you can't add frames to an existing animation, nor create new animations (i.e. for resources currently without animation). Furthermore, the resulting animations might not make much sense.

An example: during the water spouting of the Whale, the animation kind of loops back and forth. There is no way you can get this loop out using CivSprite. But within this limitation, you can change the animation to anything you want.

Further Notes

I have the intention to start working on a more advanced sprite editor, which would include the editing of animation properties...

Many thanks to DracoOmega (Zarion) and Angelo Scotto. I would probably never have started this if it hadn't been for them.

You may use and distribute this program freely, as long as the original package remains intact and no money is involved. Use at your own risk, blah blah blah...