Updated, August, 9th, 2002
The map file contains a short 3-line header followed by up to 15 blocks of text. The first block gives terrain type, the second elevation, the next 12 hexside features, and the last place-names.
Reference is made to the BGW Hougoumont map from time to time as an example. Maps are very similar between games.
The first number is the base elevation, or height above sea level in metres of the starting elevation (value 0 in the elevation block, which I will deal with below). In Hougoumont, this is 70 so the lowest elevation level is 70m above sea level.
The second number is the height in metres of each level of elevation. In the Hougoumont map it is 10m. The program multiplies this by the value in the elevation block and adds it to the base elevation to get the result which it displays.
The third number is the direction of North, coded anti-clockwise as follows:
top | 0 |
upper-left | 1 |
left | 2 |
lower-left | 3 |
bottom | 4 |
lower-right | 5 |
right | 6 |
upper-right | 7 |
The fourth number is a checksum value, which is calculated by totalling certain of the values in the map file. See below for a detailed account of calculating the checksum.
In HPS Jena, a fourth number is introduced, either 0
or 1. We have no idea what is the reason of that's number presence.
If you know its use, just tell me about it.
The character codes for the terrain types, and their checksum values, are as follows:
code | terrain type | checksum |
b | building | 5 |
c | chateau | 6 |
f | forest | 2 |
o | orchard | 3 |
r | rough | 8 |
s | marsh | 4 |
v | village | 7 |
w | water | 1 |
e | field | 6 |
(Each character code leads to a .bmp terrain tile file as is explained in .8 HERE.)
Each of these blocks 3-14 is headed, on a line of its own, by either a "0" or a "1". If by a "0", then no data follows; if by a "1", then data follows and the full matrix must be filled.
This data is in the form of a series of characters representing North-West, North, etc, hexsides and any combination of them. Here also spaces represent hexes with no marked sides.
Thus roads as well as hedges or walls are treated purely as hexsides by the program. A road starting in the middle of a hex and passing through the South-East hexside has exactly the same character code and checksum value as a hedge along the South-East hexside. Note that a road passing from the North-West to the South-East would have the same code as two hedges, one to the North-West, and one to the South-East. And note further that a hedge requires to be defined also in the adjoining hex, as do most similar types such as walls and streams.
These various character codes which have a purely directional meaning by themselves, gain their terrain meaning from whichever block they appear in, as follows:
block | hexside type |
3 | paths |
4 | roads |
5 | pikes |
6 | railroads* |
7 | streams |
8 | creeks |
9 | hedges |
10 | (low) walls |
11 | embankments |
12 | high (walls) |
13 | gates |
14 | forts |
This data is laid out in a table with an understandable pattern. One starts with North, then North-East, then combines the two; the 4th value is South-East, to which one then adds the pattern of the first 3, and so on.
The checksum values follow this pattern starting at 1. This progression gives, for the six points of the hex "compass", the following checksum values:
North | 01 |
North-East | 02 |
South-East | 04 |
South | 08 |
South-West | 16 |
North-West | 32 |
Each combination in the table is assigned a text character, starting with various special characters and passing through the numbers 1-9 and all (capital) letters of the alphabet. Programmers will recognize it as the ASCII sequence starting at hex (-adecimal... let's not get confused!) 21, and ending at 5F.
Here follows a complete list of these, showing the character used, the hexsides, and the checksum value. (The sequence I use is always clockwise from North -- No;NE;SE;So;SW;NW -- so a browser search can be used to find a particular combination):
char | Hexsides | csum |
! | No. | 001 |
" | NE. | 002 |
# | No;NE. | 003 |
$ | SE. | 004 |
% | No;SE. | 005 |
& | NE;SE. | 006 |
' | No;NE;SE. | 007 |
( | So. | 008 |
) | No;So. | 009 |
* | NE;So. | 010 |
+ | No;NE;So. | 011 |
, | SE;So. | 012 |
- | No;SE;So. | 013 |
. | NE;SE;So. | 014 |
/ | No;NE;SE;So. | 015 |
0 | SW. | 016 |
1 | No;SW. | 017 |
2 | NE;SW. | 018 |
3 | No;NE;SW. | 019 |
4 | SE;SW. | 020 |
5 | No;SE;SW. | 021 |
6 | NE;SE;SW. | 022 |
7 | No;NE;SE;SW. | 023 |
8 | So;SW. | 024 |
9 | No;So;SW. | 025 |
: | NE;So;SW. | 026 |
; | No;NE;So;SW. | 027 |
< | SE;So;SW. | 028 |
= | No;SE;So;SW. | 029 |
> | NE;SE;So;SW. | 030 |
? | No;NE;SE;So;SW. | 031 |
@ | NW. | 032 |
A | No;NW. | 033 |
B | NE;NW. | 034 |
C | No;NE;NW. | 035 |
D | SE;NW. | 036 |
E | No;SE;NW. | 037 |
F | NE;SE;NW. | 038 |
G | No;NE;SE;NW. | 039 |
H | So;NW. | 040 |
I | No;So;NW. | 041 |
J | NE;So;NW. | 042 |
K | No;NE;So;NW. | 043 |
L | SE;So;NW. | 044 |
M | No;SE;So;NW. | 045 |
N | NE;SE;So;NW. | 046 |
O | No;NE;SE;So;NW. | 047 |
P | SW;NW. | 048 |
Q | No;SW;NW. | 049 |
R | NE;SW;NW. | 050 |
S | No;NE;SW;NW. | 051 |
T | SE;SW;NW. | 052 |
U | No;SE;SW;NW. | 053 |
V | NE;SE;SW;NW. | 054 |
W | No;NE;SE;SW;NW. | 055 |
X | So;SW;NW. | 056 |
Y | No;So;SW;NW. | 057 |
Z | NE;So;SW;NW. | 058 |
[ | No;NE;So;SW;NW. | 059 |
\ | SE;So;SW;NW. | 060 |
] | No;SE;So;SW;NW. | 061 |
^ | NE;SE;So;SW;NW. | 062 |
_ | No;NE;SE;So;SW;NW | 063 |
Values are:
left | 0 |
center | 1 |
right | 2 |
black | 0 |
blue | 1 |
green | 2 |
So in the Hougoumont file, the line :
2.5 0.5 1 1 0 Chemin de Genappe ŕ Braine l'Alleudmeans text "Chemin de Genappe ŕ Braine l'Alleud" occurs in the center of hex (2,0), with font size 1, justified center, and in black.
The formula is in fact:
(columns.rows) + columns + rows
So, for the Hougoumont matrix of 23.17, we get:
(23.17) + 23 + 17 = 431
Once this base has been calculated, the non-clear terrain character values are accumumulated as indicated in the table above.
Note that inserting a non-listed character as a terrain type subtracts 1 from the checksum instead of incrementing it. The map loads, but displays this hex as "Blocked" with its image greyed-out, an interesting quirk...
The values in the elevations block do not affect the checksum. Neither does any data in the place-names block.
Only in campaign Eckmuhl you have to add
1545 to the map checksum value.
Other games has other values, the list is not complete :
Russian campaign adds 2587
Campaign Waterloo adds 1677
Campaign Wagram adds 1439
Campaign Corinth adds 1559
Spaces in the hexside blocks do not affect the checksum. Other hexside character values are accumulated as indicated in the table above.
The checksum can be calculated either manually, or using a checksum calculator utility. This will be explained in a later 'making maps' page.
8. Displaying the terrain
Each character code for terrain in the first block is read by the program as an instruction to display a specific part (icon) of a bitmap file.
Block 1 character codes "e" - "b" - "c" - "v"
leads to 3Dfeatures100.bmp file
3Dfeatures100.bmp file is a bitmap file whose dimensions are : 900 pixels width x 700 pixels height.
3Dfeatures50.bmp file is the same as above, only halved in dimensions, to use when you zoom out the map.
We call this file : terrain tile.
It is divided by the program in 6 columns and 5 lines, forming 30 icons, each 150 x 140 pixels
arranged in the following patern :
FIELD FIELD FIELD FIELD FIELD FIELD BUILDING BUILDING BUILDING BUILDING BUILDING BUILDING CASTLE CASTLE CASTLE CASTLE CASTLE CASTLE VILLAGE VILLAGE VILLAGE VILLAGE VILLAGE VILLAGE VILLAGE VILLAGE VILLAGE VILLAGE VILLAGE VILLAGE character code "e" tells the programm to display on the map, at the corresponding column/row hex, one of the six "FIELD" icons. The program chooses one of the field icons randomly.
character code "b" tells the programm to display, with the same method, one of the six "BUILDING" icons.
character code "c" tells the programm to display, with the same method, one of the six "CASTLE" icons.
character code "v" tells the programm to display, with the same method, one of the six "VILLAGE" icons.
Some of the village icons are made for hexes crossed by a road, where houses are more scattered.
The background colour of this terrain tile is transparent. The colour of the pixel at position x = 0, y =0 determines which colour will be used by the program as "transparent" for this file.Block 1 character codes "o" - "f"
leads to 3Dtrees100.bmp files
3Dtrees100.bmp file is a bitmap file whose dimensions are : 900 pixels width x 564 pixels height.
3Dtrees50.bmp file is the same as above, only halved in dimensions, to use when you zoom out the map.
It is divided by the program in 6 columns and 6 lines, forming 36 icons, each 150 x 94 pixels
arranged in the following patern :
FOREST FOREST FOREST FOREST FOREST FOREST ORCHARD ORCHARD ORCHARD ORCHARD ORCHARD ORCHARD FOREST FOREST FOREST FOREST FOREST FOREST FOREST FOREST FOREST FOREST FOREST FOREST FOREST FOREST FOREST FOREST FOREST FOREST ORCHARD ORCHARD ORCHARD ORCHARD ORCHARD ORCHARD character code "f" tells the programm to display on the map, at the corresponding column/row hex, one of the six "FOREST" icons. The program chooses one of the forest icons randomly.
character code "o" tells the programm to display, with the same method, one of the six "ORCHARD" icons.
Some of the icons are made for hexes crossed by a road, where trees are more scattered.
The background colour of this terrain tile is transparent. The colour of the pixel at position x = 0, y =0 determines which colour will be used by the program as "transparent" for this file.Block 1 character codes "r" - "s"
AND
Block 2 character codes for elevation levels
leads to 3Dground100.bmp files
3Dground100.bmp file is a bitmap file whose dimensions are : 900 pixels width x 1598 pixels height.
3Dground50.bmp file is the same as above, only halved in dimensions, to use when you zoom out the map.
This file is used to display elevation levels as well as rough terrain and marsh terrain.
It also includes shadowed hexes with various use by the programm : display hexes visible by a unit, blocked hexes, etc.
It is divided by the program in 6 columns and 17 lines, forming 102 icons, each 150 x 94 pixels
arranged in the following patern :
The first 14 lines are used to display elevation levels from the lowest (1st line) to the highest (14th line).
LOWEST LOWEST LOWEST LOWEST LOWEST LOWEST HIGHEST HIGHEST HIGHEST HIGHEST HIGHEST HIGHEST MARSH MARSH MARSH MARSH MARSH MARSH ROUGH ROUGH ROUGH ROUGH ROUGH ROUGH BLOCKED VISIBLE ? OTHER TERRAIN TILES :
NOTE : files dimension is not given here every time, but can be calculated very easily
3DWater100.bmp : used to display water hexes
dimensions : ___ width * ___ height pixels / __ columns, __ rows / __ icons each ___ * ___ pixel
3Dstream100.bmp : used to display stream hexsides
dimensions : ___ width * ___ height pixels / __ columns, __ rows / __ icons each ___ * ___ pixel
3Dcreeks100.bmp : used to display creeks (rivers) hexsides
dimensions : ___ width * ___ height pixels / __ columns, __ rows / __ icons each ___ * ___ pixel
3Dblocked100.bmp : used to display : walls, high walls, hedges, embankments hexsides
dimensions : ___ width * ___ height pixels / __ columns, __ rows / __ icons each ___ * ___ pixel
3Dmain100.bmp : used to display main roads (aka pikes)
dimensions : ___ width * ___ height pixels / __ columns, __ rows / __ icons each ___ * ___ pixel
3Dpaths100.bmp : used to display paths (of course)
dimensions : ___ width * ___ height pixels / __ columns, __ rows / __ icons each ___ * ___ pixel
3Droads100.bmp : used to display roads (minor roads)
dimensions : ___ width * ___ height pixels / __ columns, __ rows / __ icons each ___ * ___ pixel
3Dfords100.bmp : used to display fords
dimensions : ___ width * ___ height pixels / __ columns, __ rows / __ icons each ___ * ___ pixel
3DHexedges100.bmp : used to insert between some hexes so the map don t look to geometric
dimensions : 450 width * 132 height pixels / 6 columns, 2 rows / 12 icons each 75 * 66 pixel
3Dbridge100.bmp : used to display bridge. Line 1 show the bridge undamaged, line 2 damaged bridges
dimensions : 408 width * 156 height pixels / 3 columns, 2 rows / 6 icons each 136 * 78 pixelEach of this tile has a "*50.bmp" counterpart for zoom out function.
Each terrain tile has a 2D counterpart to use in 2D view.