The Gunship Workshop
This area is a clearinghouse of information
relating to how Gunship works,
and how to make it better. Corrections, discoveries and suspicions are welcome.
NOTE: in October of 2001, we had a huge breakthrough in our ability to access, and manipulate the origianl graphic files such as object "skins" and terrain tiles. I've made numerous corrections below (marked by red lettering), to reflect this new information.
Last update: 01 March 2003
Sound Elements | ||
Overview | Overview | under construction |
Skins and 3DZ files | images(1).cat | |
Terrain | Complete list of the
files referenced in gunship.exe Gunship file List page (345kb) or Excel Spreadsheet here |
|
Placing 3D objects - 1 | ||
Placing 3D objects - 2 | ||
Catalogue of 3D objects |
Graphic elements
Overview
GS (like most 3D sims), uses 3D wireframes
(individually or in groups) to create objects, and terrain data to create topography. GS
then uses pictures in .pcx format to cover both. The pictures used to cover 3D objects are
called "skins", and the pictures used by GS to "pave over" the
topography are called "tiles". Each tile is slightly larger than the size of the
airport in GS. Each of these tiles represent an
area roughly 250 meters square
Top
Skins
The skins are .pcx pictures which are given shape by a 3D
wireframe. The wireframes are stored in the data/3DZ directory as *.3d? files,
and may be customizable soon thanks to a new editor being built by one of the European Air
War enthusiasts, Alessandro
Borges (EAW is an immediate predecessor to Gunship, and very similar to GS in many
ways). This editing capability would let us alter or add to the shape of existing objects,
(for example, adding weapons racks to the Blackhawk). The Heloswapper
program copies and renames these files in various ways to trick GS into displaying new
combinations of existing 3D objects.
Here are a couple of skins from Gunship as examples: Gunship uses the same 256 x 200 256 color .pcx for most objects, but the hi-resolution helicopters and cockpits each use multiple 256 x 256 256 color pcx skins.
AH-1W Cobra skin AH1W_h.pcx |
One of the Apache cockpit skins COCKPITC.pcx |
As is commonly done in games and sims, all the
picture files are archived into one or more large catalogue files. In this case we
think they are data/images.cat and data/images1.cat.
These catalogues are compressed using one of the LZFile methods (I think). It
appears that images1.cat also contains numerous code libraries, which
probably explains why it's so well protected.
In many games built this way, you can make a new skin, then place it in a certain
directory. When the game launches, it checks first to see if a skin file that it needs
for, say, a Hind fuselage is in that directory or not. If it is, it uses it. If not, it
gets it from its compressed catalogue file. This works with the graphics used in GS .
We can identify the name of the .pcx graphic file for a particular 3D object, (i.e., the
name of its "skin"), by using one of the three intriguing little utilities
shipped with Gunship in its dat\3DZ directory named see3dzpcx.exe .
To try this, use Windows Explorer or My Computer to browse to your Gunship!\data\3DZ directory. Now click your Windows Start button, select "Run", and type the word "command" into the "Open:" box. When you click OK, you will be right back in the DOS world of 1985, with a prompt that shows that your 3DZ directory is the current path. Type "dir *.3dz | more", and you will see a list of all the 3D object file names, such as "TRUCK_H.3DZ". Now if you type: see3dzpcx TRUCK_H.3DZ and hit enter, you will see that the filename for the graphic skin for that 3D object is "ZIL135H.PCX"
So what, you may well ask.
Well, say you wanted to repaint that truck in desert camo, you would need to edit the 256 color .pcx skin file named ZIL135H.PCX
What about the other two utilities? Not exactly sure what use they are. I'm actually more intrigued that they are there at all. I'm not sure about usage syntax for either of them.
One is 3dzread.exe, and after looking at the code, it seems to be meant as a converter to create *.3db and/or *3dn files from the original *.3dz file. Here is what Petzel taught me about the formats of these *.3d? files:
Each 3d object has 3
versions, 1 for each of the following PC video settings:
*.3db
= D3D render only
*.3dz
= Software render only
*.3dn
= 3DNow accelerated. (3DN = Three-dimensional Radon Transform to
display 3d objects) computers with the AMD 3DNow chip use this.
The other is pca3dz.exe . This is used to convert .pcx files to .pca files. I'm not even sure what a .pca file is, but I think that a .pca file is a pcx filewith a transparent background.
Terrain
So far, we've only been able to figure out how to use Larry Hookins' editor from M1 Tank Platoon 2 to manipulate the
height of the terrain (topography). I finally realized that the GS terrain files in the
World directories were all set to "read-only", so the editor couldn't change
them. Remove that restriction, and it works fine.
We know basically how the tiles are arranged to form new maps. A 256 x 256 256 shade grayscale picture in .raw format named shade.dat in each Data/World/ file tells GS which tile to put where. The RGB value of each pixel is keyed to one of 64 tiles (from a collection of 84) in 4 different orientations (NSEW) for a total of about 256 tiles on each battlefield sized map. Change the RGB for that pixel, get a different tile. The file height.dat determines the height (in meters?) of the top left and bottom right corners of each tile.
Here are examples from the NPOLAND world:
There are several files which define each world. Here is a list:
Name | Used for | View as |
campaign.dat | Unknown | .RAW graphic |
height.dat | Topography of the terrain | .RAW graphic |
objects.txt | Places roads or object groups | Text file |
shade.dat | Controls type and location of tiles | .RAW graphic |
shades.txt | Lists the file names (*.pcx) for the 64 tiles used in this world | Text file |
terrain.dat | Unknown | .RAW graphic |
tiles.txt | Very interesting. Contains references for tiles, lighting, weather. I've played with this a bit, but could not see the results in GS. Inactive? Worth exploring further.. | Text file |
treerun.dat | A holdover from M1TP2. Places vertical or horizontal rows of trees. Not used in GS map design, but works in Larry Hookins' editor. I wrote "HI" in kilometer high letters across NPoland.. Maybe use to place orchards? | .RAW graphic |
work.dat | Unknown | .RAW graphic |
These pics show my test area. A new ocean with a
grid of all the shades used in shade.dat for NPOLAND. Oceans are easy. Land is hard.
Organizing them into a new map may take a while...
Platoons
This is really where Gunship enhancement got started a couple of years ago. This is covered in detail in the Mission Editing guide here. Suffice it to say that you can create incredibly detailed missions in Gunship. Don't forget Rudi's GunTool, too. It isn't that hard, (heck, I've done it myself..), and it's lots of fun.
Objects - One way to do it
This is a really interesting area. Jim Trapp led the exploration of this, and it's turning out to be a rich topic.
Objects are, oddly enough, the 3D objects displayed on the ground while you are flying that snazzy virtual helicopter around. Houses, Trees, office buildings. You can see them all here in my catalogue of 3D objects.
The display location of these objects is controlled by the files in this directory (US path shown):
C:/Program Files/Microprose/Gunship!/Data/Tiles/Data/
Lets look at what's inside an easily recognized one:
airport.txt:
32
OBJ: 27 182 152 90 0
OBJ: 27 182 130 90 0
OBJ: 27 182 107 90 0
OBJ: 27 182 85 90 0
OBJ: 27 182 63 90 0
OBJ: 28 87 166 0 0
OBJ: 29 88 141 0 2
OBJ: 40 88 131 0 0
OBJ: 29 156 48 180 2
OBJ: 29 149 48 180 0
OBJ: 20 191 53 90 0
OBJ: 38 88 135 0 2
OBJ: 29 163 48 180 1
OBJ: 29 171 48 180 2
OBJ: 20 191 74 90 1
OBJ: 20 191 96 90 2
OBJ: 20 191 118 90 1
OBJ: 20 191 141 90 2
OBJ: 20 88 156 270 1
OBJ: 20 88 147 270 1
OBJ: 29 87 162 0 0
OBJ: 26 14 89 0 2
OBJ: 26 14 98 0 3
OBJ: 26 14 106 0 2
OBJ: 26 14 114 0 3
OBJ: 45 228 62 0 3
OBJ: 45 242 84 0 3
OBJ: 45 144 224 0 3
OBJ: 45 212 235 0 3
OBJ: 45 18 35 0 3
OBJ: 41 217 104 90 2
Isn't that fascinating, you say.
What this file does, is tell Gunship which object to place where on every tile named "airport". The tiles are 256 x 256 pixels, and the X / Y coordinates are roughly in meters. So each tile is about 250 meters square.
It parses out like this:
OBJ: | 27 | 182 | 152 | 90 | 0 |
Put Object | number (hangar) |
at coords X | and Y | facing (?) | and display at this detail level* |
The first line, (in this case "32"), refers to the number of objects on the tile. 32 also happens to be the maximum number of Objects that you can place on a particular type tile.
*Jim figured out that the last number is actually the 3d object density setting enumeration. A 3d object density setting of high displays objects level 3 and lower, medium density displays objects level 2 and lower, etc., right down to software 3d object density displaying level 0 objects only.
The tricky part in placing objects, is that when you tell GS to put 10 houses in the middle of say the Grass1 tile, you apparently get 10 houses on each and every Grass1 tile in every 16km2 mission area in every World you use.The terrain can wind up looking very crowded. More like suburbia than Poland. Which is fine if that's the look you're after. I suspect that game performance might eventually suffer from too many objects, but maybe not. But if making new terrain, you can make a new set of object files to place things differently.
Examples:
Here is a new version of the airport that I'm working on. Note real flashing runway lights, admin building, and antennas moved away from the middle of the runways. There is even an ammo dump that explodes when hit. | |
Here is a view of Jim Trapp's house enhancements. Details here. |
Here's another tantalizing bit: We've been discussing the directory data/tiles/data/*.txt . GS also creates another empty directory data/tiles/geodata. I would LOVE to know what that was intended for...
So that's basically what we know so far about placing individual 3D objects. But what about placing groups of objects?
Objects - The other way to do it
There is also a way to place groups of objects as a set, according to the same type of coordinates used for waypoints and unit placement. This is also how roads are placed.
Take a look in this directory. Each of the five Worlds has an objects.txt file like this. (US path shown):
C:/Program Files/Microprose/Gunship!/Data/World/Ukraine/objects.txt
Man, there is a lot of stuff in there.
Here is an example, and how Gunship parses it out:
ROAD | 1 | 6320 | 123149 | 6038 | 123149 |
Put a road | of this type | Starting at coords X / Y | and ending at coords X / Y | ||
TOWN | 1 | 4851 | 1148 | ||
Put a set of structures | of this type | at coords X / Y |
Roads
There are two types of roads (1 and 2). They appear to be the same, but I suspect they render differently depending your graphics settings. Not sure about this. They also wander quite realistically between start and end.
Towns
There are only five groups of structures, (generically called Towns), used in GS. It may be possible to add more types someday.
Here is a screencap of each type:
Even though there are only five types of "towns", you can place them anywhere on any map that you want. And you can combine them, too. However towns 1,2 and 3 only seem to work if place them on the appropriate city or airport tile. And of course, they are already there.
|
Here is an example of this method used to build a Communications Complex using Roads, Town 4 and Town 5: |
/*comm center by fng2k
8/2001*/ ROAD 1 104625 152765 102300 33300 ROAD 1 102300 33300 102000 33200 ROAD 1 102302 33300 102002 33200 ROAD 1 102300 33300 102000 33600 ROAD 1 102300 33300 102600 33200 ROAD 1 102300 33300 102600 33600 ROAD 1 102300 33300 101900 33300 ROAD 1 102300 33300 102200 32900 TOWN 5 102000 33100 TOWN 5 102000 33200 TOWN 5 102000 33500 TOWN 5 102000 33600 TOWN 5 101900 33300 TOWN 3 102300 33300 TOWN 5 102500 33100 TOWN 5 102600 33200 TOWN 5 102500 33500 TOWN 5 102600 33600 TOWN 4 102000 33000 TOWN 5 102200 32900 TOWN 5 102200 32930 |
And here is the code for it. If
you want to try it out, here's how. As is common for most of these mods, you will first
need to go to the "properties" of this file (in windows explorer, right-click
the file and choose "properties"), and then un-select the "read-only"
box. Copy all the code in the box at left to your clipboard (ctrl+c), then open the following file in a text editor and paste it (ctrl+v) at the end after all the existing code (US path shown): C:\Program Files\Microprose\Gunship!\Data\World\Czech\objects.txt To view it, write a mission within range of those coordinates, or copy the following into a new text file, and save it in your data/battles/player directory: TITLE: Comm Center test |
More to come...
File and Directory information
The following is what we have learned about the
formats and functions of various files used in Gunship! . This is organized according to
the directory they are kept in. All this is based upon the US version of Gunship, and I
would be interested to hear of any differences in the structure of the European versions.
\Gunship
The big one here is of course gunship.exe. Rummaging around in here with
a hex editor has been very informative. I'll post a list of all the text strings in it someday...
The other important one is the readme.rtf file, containing lots of
important info. One intriguing thing are these references in its header:
Uses 3D ENCICLOPEDIA by DE ESPONA
Infográfica
Uses Miles Sound System. Copyright © 1991-2000 by RAD
Game Tools, Inc.
Uses Bink Video, Copyright © 1997-2000 by RAD Game
Tools, Inc.
The 3D enciclopedia refers to this group.
It's a fascinating place to visit, and implies that because MicroProse didn't actually
create all the 3D objects in Gunship, there must be a way to convert them from some common
format to the *.3dz format used in Gunship and European Air War. Or it maybe that this
company was simply the source of the vehicles and aircraft used in the videos used
throughout Gunship, which look slightly different than those in the missions.
The sound and video systems are cool, too. Check them out.
Gunship!\data\
This directory contains a variety of interesting files, particularly the two biggest ones:
images.cat 21.6 MB
images1.cat 23.7 MB
These are the ultimate treasure for those interested in GS mods and enhancements. If we
want to make or edit aircraft skins,terrain tiles or even aircraft performance, we need to
be able to read from these files. And now we
can!
They contain large numbers of individual files, archived into one catalogue, similar to
the way multiple files can be combined into one .ZIP file. The compression method seems to
be a variant of the compress.exe/LZexpand.dll system used among C programmers, but I could
be very wrong. It has resisted all amateur access attempts so far, but to my knowledge, no
high-level C programmers have really looked at it yet. (any volunteers?)
There are several fan-built utilities available for other MicroProse titles that use .cat
files, such as Transport Tycoon and Gran Prix 2. I haven't had much
luck using them on Gunship files, because they tend to be custom-written for those games.
I recommend looking at them if you are interested. This one (decat.exe for Transport Tycoon) did extract
some files from images.cat as .bin BLOBs, but I still can't figure out what they are! I
suspect they are sound files.
What we really need is a
picpac.exe utility like the one MicroProse released to the European Air War community.
But I'm not holding my breath...
And I just made an interesting discovery. In hindsight, it's a real forehead-slapping
"DOH!" situation. I had been using a working assumption, (based on string data
in gunship.exe), that images.cat contained code libraries and some graphics used in
Gunship prior to launching a mission, and that images1.cat contained all the 3D object
skins, tiles and sprites displayed during a mission. But I was always puzzled as to why
there was a data\images directory, but not a data\images1 directory. (These .cat files are
accessed by GS transparently, basically as though they were a set of hidden directories.)
As is not uncommon, I was completely wrong. Guess what:
images.cat and images1.cat are the same.
Or at least, they are different versions of the same catalogue. If you rename the two
files as each other, Gunship still seems to work fine! (Although I have just started
playing with this).
So this raises some intriguing questions: Why ship two files? And why is one 2 MB larger
than the other? What's in there?
Here are some wild-a** guesses:
In any case, I encourage folks to swap the names of
these two files, and play around with it for a while to see if any differences show up.
Don't do this when flying in multiplayer though, because as we learned with HeloSwapper,
GS does swap some files around in unknown ways. Although if two brave souls did make this
change and tried multiplayer, it could be very enlightening...
gunship!\data\Images
Speaking of which...
In many games, you can make a new skin, then insert it into the game by placing it in a
certain directory. When the game launches, it checks first to see if a skin file that it
needs for, say, a Hind fuselage is in that directory or not. If it is, it uses it. If not,
it gets it from its default compressed catalogue file. This works with the graphics
used in GS too. (That is how this mod does it.)
The directory contains four files named "spriten'.ACT".
These are Adobe Photoshop Color Tables
(palettes), and I assume these supercede the
same files stored in images.cat. We need a volunteer to delete them temporarily and find
out what changes.
battle.txt
This is a copy of the last mission flown, created at launch, and is the file
transmitted to other Players by the Host in a multiplayer session.
mpssndr.dll
This is a C library containing the sound drivers used in Gunship.
mss32.dll
This is a windows sound driver library.
credits.txt
It's amazing to see just how many people worked on this great program. Where are
they now?...Drop me a line if you have any Gunship! info you can share.
Gunship!\3dz
Here are the 3D object shape files that Heloswapper manipulates. Their
exterior graphics, called "skins", are in .pcx format and contained in the
data\images.cat and images1.cat files described above.
Most 3d objects have three versions, one for each of the following PC video settings:
The 3D objects have varying degrees of detail,
depending on how visible they are in the game. They range from low-resolution versions
used to display an object at a distance, medium detail, for intermediate distance and
scenic elements, up to the meticulously detailed close-ups of the helicopters.
For example:
tigert2.3db | tiglolo.3db | tigert.3db | tiger.3db |
Most aircraft and vehicles are made up of multiple
components. Tanks, for example, usually have at least two component files, such as
T80_H.3dz ("H" for Hull), and T80_T.3dz ("T" for Turret). The Apache
has more than 50, including the distance views, rotors and individual weapons. Many
structures and vehicles also have two versions. For example, TENT_1.3dz is an intact tent,
while TENT_1W.3dz is the "wrecked" version of a tent.
The *.3dz file format was also used by MicroProse in their popular European Air War
simulator. (See Cord's 3DZ
tutorial). There is a very active EAW
community , and many people enjoy designing and painting their own aircraft. One
utility they use called 3D!Studio can be
used to modify the 3D wireframe shapes. It's author, Alessandro Borges, will be
releasing a updated version soon which will also allow rescaling the objects, so we may be
able to swap 3D objects between EAW and GS in the future, or create and add entirely new
ones. EAW aircraft are roughly 1/4 the size of the aircraft modelled in Gunship, as Pretzel discovered.
Gunship\Data\Battles
There are several subdirectories here;
Hint: take a close look at the missions in the
campaign and Training directories. (Open them with any text editor.) There are some
unusual parameters that imaginative battle builders could have fun using in custom
missions....How about your own soundtrack?
Gunship!\Data\cockpits
There is only one file in here, but it sure surprised me! Open cockpit.dat in any text
editor and look at the parameters: they all relate to TANK cockpits!
I suspect that full Tank Platoon! functionality is VERY close to the surface in Gunship,
and that a small team of developers would have little difficulty in enabling it.
Gunship!\data\Fonts contains, of all things, fonts for the
text displayed in Gunship.
Gunship!\data\GSpeech|RSpeech|UKSpeech|Speech
Gunship!\data\Sound
The first four directories contain all the .wav files of the voices heard in Gunship. They
are identical, other than being in German, Russian, British and American. Each has the
file PHRASE.TXT which acts as an index. An amazing amount of work, if you think about it.
JT discovered that Gunship ignores the phrase.txt files in RSpeech, UKSpeech, and GSpeech.
So, putting his modified phrase.txt file in the Speech directory affects the
phrases of all nationalities. "I never would have guessed that the game behaves
this way. ", says he. "Shrug", says I.
Sounds contains all the sound effects.
All of these audio files are all in standard .wav format, so they can be edited or
replaced. There are tremendous possibilities for adding or manipulating the audio in
Gunship. See the mods page for Jim Trapp's audio enhancements.
Gunship!\Data\Movies
These are the cool videos displayed throughout Gunship. They are in a format called Bink
Video, and a free player\.avi converter is available here. You could even make your own!
Gunship!\data\Map
This directory contains two types of files:
Gunship!\data\Tiles\data
These 82 text files contain the settings which control how and where terrain-related 3D
objects are displayed. Amazing stuff. Full details here.
There is also another directory created at installation called Gunship!\data\Tiles\geodata.
It's empty, but tantalizing. "Geodata" is a term sometimes used with digital
mapping...
Gunship!\data\World
These are the five geographic regions shipped with Gunship. See here for file info.
This is where you put Larry Hookins' M1TP2 Terrain Editor
if you want to play with it. Remember to remove the "Read Only" flag in the
properties of all the World files first.
Sound elements
Under construction
Email: gshelipad@lycos.com