RESOURCE.PLN is the picture data file for DOS Planets. It is also used by various other programs, including VPA and PVCR. This section also describes Winplan's use of pictures, which is structurally similar.
File format information mostly by Frank Hempel.
RESOURCE.PLN contains 151 images numbered from 1 to 151 (important if another file such as HULLSPEC.DAT references an image). Every picture consists of a 5537 byte record built up as follows:
+0 WORD Width of image, always 105
+2 WORD Height of image, always 93
+4 n BYTEs For each scanline 4 byte sequences. Each of the four byte
sequences is ((Width+7) DIV 8) bytes long, in this case
4x14 bytes. The first sequence contains information for
color plane 0, bit 7 is the left-most pixel. Then the color
planes 1 to 3 follow.
This matches the organization of VGA video memory (the
BASIC commands PUT and GET normally work with memory dumps,
like here).
+x n BYTEs unused
+5300 15 WORDs Color palette. 5 records of 3 words:
+0 WORD Red (0..63)
+2 WORD Blue (0..63)
+4 WORD Green (0..63)
See also note below.
+x n BYTEs unused. Non-existent for the last picture (#151).Winplan doesn't use RESOURCE.PLN, the images are stored as single Bitmap files, as WINPLAN\BMP\VPLxx.BMP, xx is a 1- to 3-digit bitmap number. That is, the first RESOURCE.PLN picture corresponds to VPL1.BMP. There are 262 images following this scheme, most are new planet pictures. See also WPVCR.DLL.
Additionally, there are the WINPLAN\BMP\VPAUXxxx.bmp files. These are used when reading messages from 3rd-party programs, see MDATAx.DAT.
The BMP files have no color restrictions; palette allocation and recoloring is left to Windows' built-in API functions.
Notes on the Color Palette
Planets uses the 16 color mode of the VGA card. From these 16 colors, 11 are fixed:
Color | Red Green Blue |
=========|=======================|=============
0 | 0 0 0 | Black
6 | 37 18 3 | Red
7 | 42 42 42 | Light gray
8 | 20 19 22 | Dark gray 1
9 | 0 0 62 | Light blue
10 | 12 55 12 | Light green
11 | 17 17 17 | Dark gray 2
12 | 58 0 0 | Light red
13 | 11 11 11 | Dark gray 3
14 | 60 59 0 | Yellow
15 | 57 57 57 | WhiteColors 1 to 5 are defined by each image. In some pictures, PLANETS.EXE shuffles the color components.
| Hull | Color | Transform.
========================|=======|=======|=============
Image 33 | | |
Super Transp. Fr. | 18 | brown | none
Neutronic Ref. | 104 | green | R/G
Merlin | 105 | blue | R/B
------------------------|-------|-------|-------------
Image 47 | | |
T-Rex | 23 | brown | none
Madonnzila | 49 | green | R/GR/G means Red and Green component are exchanged, R/B means Red and Blue component are exchanged. This transformation is hardwired in PLANETS.EXE and depends on the hull number only. In the standard ship list, some other pairs of hulls share a picture, too, but for those, no tricks are played to the palette.
For planets, PLANETS.EXE also uses the palette to change the images. Desert planets appear in sand colors while arctic planets appear cold as ice. In pictures for factories, defense and mines the ground has the same color as the planet so that the buildings always stay on a different ground. See also the section on planets below.
Some images may not use the special colors 1 to 5:
- 8 (scanner), always combined with a ship image
- 21, 48, 52, 71, 83, 93, 94, 115, 126, 138, 151 (Logo), always combined with a race member (main menu) or ship image (build screen)
Images of ships or planets may not use colors 6 to 10. In VCR, where 2 ships appear side by side, colors 1 to 5 of one ship are translated into colors 6 to 10, since a ship always needs the special colors. PLANETS.EXE doesn't do such translations, so that it needs to hide the planet picture by putting the scanner image (pic. 8) on it each time you request a visual scan from the planet or base screen.
Assignment of the images
All pictures not listed in the tables below are starship or planet images, see also HULLSPEC.DAT.
Race | Logo | Person | Fighter
===============|========|========|=========
1 (Feds) | 21 | 22 | 34
2 (Lizard) | 48 | 44 | 81
3 (Bird Men) | 52 | 53 | 82
4 (Fascist) | 71 | 70 | 82
5 (Privateer) | 83 | 75 | 80
6 (Cyborg) | 93 | 91 | 92
7 (Crystal) | 94 | 95 | 96
8 (Empire) | 115 | 116 | 111
9 (Robot) | 126 | 127 | 125
10 (Rebel) | 138 | 139 | 130
11 (Colony) | 151 | 150 | 145Pic. | Meaning ======|==========================
8 | Scanner Screen
23 | Starbase
30 | unused ship picture (*)
35 | Defense Post
36 | Factory
37 | Mine
38 | Planet for Mining Survey
51 | Explosion (VCR)
43 | unused planet pictureA note on picture 30: This image is not used in HULLSPEC.DAT. Anyway, VCR uses it sometimes, see VCRx.DAT.
Planet pictures
To display a planet picture, the temperature and Id number are needed:
INDEX := ( Temperature_Value + Id_Number ) MOD 13
The Temperature_Value is the value stored in the planet record, not the
Fahrenheit temperature. Each of the Index values maps to one planet
picture:INDEX | Planet Picture(s) =======|===================
0 | 1
1..4 | 39 .. 42
5..7 | 2 .. 4
8..12 | 24 .. 28The palette (special colors 1-5) are computed separately to reflect the planet's temperature. This special palette is also used to make the planetary buildings appear to stand on different ground depending on the climate.
Winplan uses a different formula:
INDEX := Id_Number MOD 95
The index maps into a table of planet pictures:INDEX | Planet Picture(s) =======|===================
0 | 1
1..4 | 39 .. 42
5..7 | 2 .. 4
8..11 | 24 .. 27
12 | 43
13..62 | 155 .. 204
63..94 | 213 .. 244Winplan does not modify the color palette, it displays the BMP files unchanged (they actually need not even be palette-based images).



