ACWCO Engineering Department

ACWCO Engineering Dept.


HPS/JTS MAPS Explained

The .map file contains the data needed to display the map for the HPS games.

Beginning with Corinth 1.02 the HPS ACW games had the .map files locked out so that only the original files would work within a particular game engine. You could make your own map file and load it into the Scenario Editor, it would work fine there and you could create a scenario file with it. However when you attempted to start the scenario file in the game engine you would get an error message.
However with the release of the JTS Overland game the .map files appear to have been opened up again. Currently HPS/JTS games that have been updated to version 2.0 or later allow maps other than the originals to be loaded.


The map file is actually a text file divided into several sections. Each of these sections contains the data need to determine different parts of the map. Once again I wish to thank the creators of the Cobexlaw site for permission to borrow from their site along with John Pumphrey, Al Amos, Greg Gorsuch who were given credit for much of the information on maps at the COBEXLAW site. Much of the information here is derived from their sites although some of it had to be changed due to differences between the ACW and Napoleonic era game engines.


1. Introduction
2. The Header
3. Block 1: Terrain Types
4. Block 2: Elevations
5. Blocks 3-14: Hexside Features
6. Block 15: Place Names
7. Calculating the Checksum


1. Introduction

The HPS/JTS map file "*.map" is a set of instructions to the main program on how to build the map in its working memory. The "*.map" files are located in the main folder of the game. The various bitmap files are located in the /map folder of the game. 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. Maps are very similar between games.




2. The Header

The header is the first three lines of text.

2.1 First line

The first line contains just one character; so far, this is  a "1" in all games.

2.2 Second line

The second line contains two numbers separated by a space. The first is the number of columns, and the second the number of rows. Thus in the Farmington map from Corinth, where the bottom right hex is (50,87) numbered 50,87 from 0,0 the values in the second line are "51 88".

2.3 Third line

The third line contains four numbers separated by spaces.

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 will be dealt with below). In Farmington, this is 360 so the lowest elevation level is 360m above sea level.

The second number is the height in metres of each level of elevation. In the Farmington map it is 30m. 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 counter-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.

The fifth number is a 0 or a 1 in all cases so far. I was not able to determine the reason for that number's presence. However Derek Hampel notified me that he discovered it sets the display 2dGround and 3dGround levels. A "0" indicates every other line in the file while a "1" is every line in the sequence.




3. Block 1: Terrain Types

This block consists of a character for each hex representing terrain type, or more precisely features which affect the hex as such, and not the hex sides. Where a clear hex is present, the character used is a space and the checksum number is 0. You can see this by selecting all the text in the block. In Farmington, you will see that a matrix of 51x88 characters is filled, even though most of them are spaces and thus invisible. This matrix must be maintained at all times if editing manually.

The character codes for the terrain types, and their checksum values, are as follows:

code terrain type checksum
d field 6
f forest 2
o orchard 3
r rough 7
s swamp 4
t town 5
w water 1




4. Block 2: Elevations

This block is always fully filled with values representing levels of elevation with 0 as the lowest level relative to the map. After the numbers 0-9, values continue with lower case letters of the alphabet, currently I have seen them as far as q giving 27 differrent elevation levels. Note that the values in the elevations block do not affect the checksum.




5. Blocks 3-12: Hexside Features

The next 10 blocks give hexside information broken down by type. All other data, apart from that dealt with above and placenames, is hexside data.

Each of these blocks 3-12 is headed, on a line of its own, by either a "0" or a "1". If by a "0", then no data follows and this hexside feature is not used on this map; if by a "1", then data follows and the full matrix must be filled as in the terrain and elevation blocks.

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 fences 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 fence 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 fences, one to the North-West, and one to the South-East. Note further that a wall requires to be defined also in the adjoining hex, as do most similar types such as streams.

These various character codes which have a purely directional meaning by themselves, gain their terrain meaning from which ever block they appear in, as follows:

block hexside type
3 trails
4 roads
5 pikes
6 railroads
7 streams
8 creeks
9 fences
10 walls
11 embankments
12 cuts


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


A checksum value for any given combination of hexsides can be calculated by adding together these base values.

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

(I have checked these values for this version and they are correct.)




6. Block 13: Place Names

The place names block has one name entry per line of text. The line consists of five numeric values and the name itself. The five values are column, row, font size, justification and color.

6.1 Column & Row

The values here have decimal places, and these indicate the precise starting (or ending--depending on justification) position of the text within the hex.

6.2 Font size

These are apparently 1-4. If you place a 0 for the Font size the location name is shown on the map in font size 1 but does not appear in the Locations window.

6.3 Justification

This, together with the decimal column/row positioning, allows for very exact placing of names and for proper placing on the far right of the map.

Values are:

left 0
center 1
right 2

In addition to positioning the text itself using a 0 or a 2 places a + sign to the left or right of the text giving the exact position of the location itself on the map. When a 2 is used the location is the center of the text.

6.4 Font color

Color values are:

black 0
blue 1
green 2

The exception to this is a building such as a house or church. In order to display a building in 2D or 3D the color number must between 3-8. The text color will always be black (color 0). Changing the color number will vary the building icon used for the hex in both 2D and 3D mode. The building displayed is determined by the color number -3. This sets the position of the building in the 2DFeatures and 3DFeatures files numbered from the left 0-5. This allows you to determine which building icon will be displayed in any particular hex although you are limited to the 6 choices in the file.

So in the Farmington file, the line
22.491 64.3438 2 1 0 Farmington
means text "Farmington" occurs in the center of hex (22,64), with font size 2, justified left, and in black.

Likewise the line
21.8727 66.0938 0 2 7 Farmington Church
means text "Farmington Church" occurs in the center of hex (21,66), with font size 1 (the 0 will prevent it from showing up in the Locations pull down window and display it in font size 1), justified left, in black and will result in building icon #4 (7-3) being displayed in the hex.




7. Calculating the Checksum

Theoretically a completely blank map file has a checksum value of zero. A map file with one column and one row, with a clear terrain type (space), has a checksum of 3. Thereafter each addition of 1 space to the row (ie. adding a new column) adds 2 to the total, but only for the first row; just 1 is added for each space in the subsequent rows. The same applies starting with one column and adding rows: initially 2 is added for each new row, but only 1 for each space in the subsequent columns.

The formula is in fact:
(columns.rows) + columns + rows
So, for the Farmingon matrix of 51 x 88 we get:
(51*88) + 51 + 88 = 4627

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.

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 'making maps' page.

In each game a different number must be added to the checksum to make the map work. You can determine this number by first determining the checksum for a map file and then comparing it to the number shown in the file. The number should be the same for all maps in a game but it varies from one game to another.




Back to the Main Menu


Page designed and maintained by Ken Miller
Last updated 12/29/2019

Note on Email Addresses:
For email links to work, the "ACWGC_" tag has to be removed from the address.
this is added to protect against spammers.