I've updated the source to work with versions of GIMP from this century. Last tested with gimp-2.4 (which is pretty impressive considering it was written in 1997 for gimp 1.x or earlier!) Download the source now!
If Ultimate Civ2 ever comes out it will add multiplayer support to Civ2, at which point I might actually want to finish this program. That is if I'm not too busy playing Age of Empires.
The latest version will always be at
http://www.ben.com/GIMP/CIV2/
as
civ2.tar.gz.
.SAV
. If you select a saved game you will get the CIV2 plugin automatically. If you want to load a map (which usually uses the .MP
extension) you'll have to select the CIV2 filetype by hand. After loading the game or map, the plugin will present you with some options:
The grayed checkboxes are not optional because the code doesn't exist to implement them, but it was more interesting to learn how to desensitize GTK widgets than to just remove the checkboxes.
The imagemaps must be the GIFs
that come with CIV2 or compatible imagemaps (from official or unofficial
mod paks).
The original GIF imagemaps contain special information encoded in the
palette so it is not possible to use arbitrary images.
The plugin also assumes
that the union of all the image palettes is small enough to generate an
indexed image as output.
If you don't
have them try getting a mod pack from a CIV2 site. I won't ship them with
the plugin: I don't want the legal hassle. The code will try to find these
images in some common locations using a simple search path, including looking
at /cdrom
and /cd
for the game CDROM.
After loading the four imagemaps and rendering the selected components, you'll be presented with an immense image (frequently 3000x1000 or larger) with several layers:
The texture images are closed when the rendering is complete. If the plugin crashes for some reason (e.g. a corrupted save file) you may be left with those images loaded. The GIMP does not provide a way for you to create views of these images but you can access them from the layers menu.
The resulting image can be flattened and saved as a GIF with no additional manipulation. Here's a detail from one saved game, showing some French and American cities and their supporting units (the unit shields are all red because there's no code to change the color as the shield is copied, see below):
The saved game loader just reads large arrays of carefully constructed structures with bitfields to describe object attributes. This has several problems: the loader is probably byte-order dependant, the structure layout may be compiler (gcc) dependant, and it is probably not the method used by the civ2 game programmers (so it's difficult to see patterns in the layout of the datastructures).
The following information isn't extracted from a saved game file or the algorithm for synthesizing the information is unknown: