Steel Panthers World at War Map Editor
(WAW Map)
Version 0.03
Copyright by Fred Chlanda
June 2000

Table of Contents
Introduction and Installation
Loading, Saving and Viewing a Map
Inspection Mode
Making a Map from a Sketch
Importing an SDTS Elevation Map
Copy and Paste
Using the Strategic Map
Tile Transfer
Saving a Map Image
Getting a Printable Map
Road Connections
Plans for WAW Map and Contacting Me

Introduction and Installation
This is an alpha version of a supplemental map editor for Steel Panthers World at War. It is not completely finished, but should be useful for making rough maps to be polished up in SPWAW's editor and (for the brave) adding custom features. You may also like the Copy/Paste feature for moving parts of maps around. This is an adaptation of my program FSPMap which can be used for Steel Panthers 2 and 3 compatible maps.

WAW Map is a WIN95/98 program. It needs at least 800x600 16-bpp display. 1024x768 or more is better. WAW Map can be placed in the directory that contains the SPWAW exe file. It will automatically use the terrain graphics located in the Shp directory there. If you don't want to use it there, you can place it in a separate directory and copy the Terxxz4.shp tiles to a subdirectory called Shp. (You can do this easily by opening a DOS window, going to the SPWAW\Shp directory and entering "copy ter??z4.shp C:\WAWMap\Shp" where C:\WAWMap\Shp describes an existing path, that is you have made a directory called WAWMap and it contains a subdirectory called Shp.) Alternatively, before loading a map, the location of the terrain shps can be specified. To override the default tile location use Files|Set Shp Directory. Just choose any file in the directory. Once tiles are loaded into WAW Map, they remain there so if you want to switch tile sets it is necessary to exit and restart WAW Map. To uninstall WAW Map just delete all of the files that came in the archive. WAW Map does not write to the Registry.

Getting Started
Use the Files|Load WAW Map File to load a SPWAW map. Maps can also be extracted from scenario or saved game files although these may contain some extraneous features (?). After the map is loaded, there will be some delay, but eventually a map should appear. Because WAW Map loads tile graphics from disk as it needs them, when you first start to move around on the map, there will be some delays as the shp files are loaded and converted to standard bitmaps. This will speed up as you get more needed images loaded. The horizontal and vertical scroll bars will move you around the map. If you want to view the the map with hex outlines, select Options|Show Hexes. Reselect to toggle off. You can also turn hexes on and off with the button showing a red hex outline in the lower right corner. Use Files|Save Map File to save a map.

Inspection Mode
Practically all of the map data is accessible for editing. Choose Options|Inspection Mode and a window will appear with several different data fields. Each time you click on a hex, data for that hex will be displayed. At this point, the nature of all of the fields has not been fully discovered. If you are going to tinker with data here, be prepared for problems in the game. The following discussion is only for the truly interested.

The data for a map is organized into several different sections instead of having all of the information for a given hex in one or two locations. Section 29 (S29) has one byte per hex and appears keyed to terrain type. Section 2 (Main) through 7 hold information about the location of the graphics, i.e. they give the xx in Terxxzy.shp (y is the zoom) and the icon number (starting with 0 ) of the graphic in the file. (The no graphic dash has a space in front of it. If you want to remove info type space-hyphen). In addition to these graphics, S28 holds information about an additional 6 tiles. The number of tiles is given then six sets of file and icon numbers. The number of tiles takes precedence. If it is 0, even though there may be tile information, it is ignored. The data in S28 appears to be only used for holding the tiles that depict the shading of slopes. Section 8 contains non-graphic information about a hex. There are 20 bytes for SPWAW. As far as I know this is what these do. The first four bytes are bitfields that describe the terrain. Bytes 4and 5 are a two byte signed integer giving the altitude. Bytes 6 and 8 give values used for armor and infantry spotting or defensive values(?). Byte 12, secondary road connections bitfield with east =1 and proceeding counterclockwise to ne =32. Byte 13, primary road connections and 14 RR connections. SPWAW does not seem to store the graphic information for roads but appears to construct roads on the fly using the connectivity information.

All of the data in the Inspection Window can be changed. Just type in what you want for a hex and press the Retain button. (Remember to do this for each hex you want to change). You can use the Copy and Paste buttons on the Inspection Window to copy an entire 20-byte record from one tile to another. When you use Paste, permanent changes are made and it is not necessary to press the Retain button. Changes will not show up on the map image until the map is redrawn. The button with the spilling green paint in the lower right can be used to redraw the map. After making the changes you want, use Files|Save Map File to save the modified map.

Making a Map from a Sketch
The purpose of this function is to give a quick method to generate a rough map of an area that you have in mind which will later be refined using SPWAW's editor. Right now it only works for Summer maps.
One can make a pretty quick map from a real or imagined map using a simple sketch. The first step is to find a map of the area you want. The default setup will use a 500x400 pixel map but other scales and sizes are optional (see below). Using your favorite paint program, trace out the elevations (or just sketch them approximately from memory). Two altitude bitmaps are included in the archive, atest.bmp and aspen_a.bmp. The latter was made by drawing over an actual 24000:1 contour map I found on the web. Elevations are color coded as follows (given as Red,Green,Blue) intensity of the color):

Level 0 Plain (100,100,100)
Level 1 Low Hill (140,140,140)
Level 2 Medium Hill (180,180,180)
Level 3 High Hill (220,220,220)
Lake (0,0,120)
Swamp (0,120,0)

Once a bitmap is prepared you can convert it to a Steel Panthers World at War map by the following steps. Using Files|Load WAW Map load a blank WAW Summer map. (On included here as CLR_MAP.DAT.) Select Tools|Import from Bitmap. This will pop up another window with a display area and a few buttons. (Click this whenever you want to see the Import window.) Load the altitude bitmap (atest.bmp) using the Load Bmp button. Then click the Alt Convert button. This will convert the colors in the bitmap to heights in the WAW map. Go back to the main map window and press Redraw (the spilling can of paint in the lower right). You will see the hills appear and some water and swamp hexes. The latter do not look very good. I have not bothered to add the necessary bordering tiles to the display (yet?). If you save the map (Files|Save Map File) then load it into the SPWAW editor, when you edit any tile, the margins around the water and swamp will change. This happens when loading a scenario even if the map is not edited. This may be a curse or a blessing, I have not decided.

No doubt you noticed the Conversion Scale on the Import window. You can set this to use different size bitmaps or to change the aspect ratio of the bitmap/SPWAW map. When you load a bitmap, the Size of the bitmap appears at the left. If you load a larger bitmap, scroll bars appear and you can scroll around the bitmap. The coordinates of the upper left corner appear right below the Bitmap size. This coordinate is used for the origin of the map generated. E.g. if you have a large bitmap loaded and set the conversion scale at 5x5 and scroll to 100,200 you will generate a map using the 100,200 to 600,600 portion of the bitmap. This could be handy for making one large altitude bitmap of an extended area that is going to be used to make a series of maps for connected battles.

A few additional terrain features can be included in a second bitmap. To use the example load the clear SPWAW map file to restart. Then load into the Import window aspen_a.bmp. We want to convert most of the bitmap so we set the conversion scale to 9 x 7 pixels (9x100 hexes wide =900 pixels and 7x80 hexes high=560 pixels). Press the Alt Convert button and Redraw the map if you want to see the terrain. Now load the Terrain bitmap (aspen_t.bmp) into the import window using the Load button. You will see red and green areas as well as a few gray areas. In the conversion process, the gray areas are ignored so you can draw this map easily by drawing over a copy of the altitude bitmap. Red areas are converted to Rough and green areas place trees on the map. The rough and trees are placed in a statistical fashion according to the intensity of their color in the RGBtriple for a pixel. The percent coverage of rough or trees is based on a scale of 155=0 to 255=100% . A red intensity of 200 gives a 45% chance that a hex will be rough. A green intensity of 175 will give a hex a 20% chance of having trees. The two can be combined. E.g. the greenish yellow areas are (175,185,0) which means that a hex in that area will have a 20% chance of being rough and a 30% chance of having trees. To add the terrain features to the map click the Ter Convert button. Press Redraw to see what happened. Once again we don't have a very nice picture, but this will be fixed by loading the saved map into SPWAW and making one edit.

In drawing the bitmap there are two additional ways that terrain can be added. I have not experimented with these. A spray can could be used to spray a high intensity color (e.g 210). The density of the spray combined with the color intensity would then control the rough and trees. Another technique might be to use a relatively low color intensity (say 165) and press the Ter Convert button several times. (Changed hexes are not removed when the button is pressed so the results are cumulative. Also note that the results are random. Each time the process is repeated, the results will be different.)

Importing an SDTS Elevation Map

WAW Map can import certain elevation maps to get an exact lay of the land. 7.5 degree elevation maps for most of the United States in SDTS format are available on line. These can be gotten by going to http://edcwww.cr.usgs.gov/doc/edchome/ndcdb/ndcdb.html or http://edc.usgs.gov/doc/edchome/ndcdb/ndcdb.html. Pick 1:24,000 DEM then FTP via Graphics to access the maps via a US Map. You will also want to get the DLG Viewer available free from the same site. Since WAW Map will only display a gray scale image keyed to elevation, it can be quite difficult to locate other features even if you are very familiar with the area. If you are lucky, there will be transport and hydrology overlays available for the area you are interested in which can be displayed in DLG Viewer. I have a street mapping program, Precision Mapping, that gives a very precise Latitude/Longitude which can be use to locate key features that can be cross referenced in DLG Viewer. The scale of these maps is about 30 yards/pixel so using 2 pixels/hex gives about the right scale for SPWAW. Altitudes are given in either feet or meters. WAW Map makes no distinction since SP elevations are all relative anyway.

WAW Map does not make a direct conversion of the DEM to an SP map. Instead it generates a standard bmp file that can be edited and then converted to a SP map using the Tools | Import from Bitmap function. To begin the process, open the SDTS window by choosing Tools | Import SDTS DEM. Use the Load DDF button to load the elevation map. In a few seconds a gray scale image with lower elevations darker and higher lighter will appear. As you move the cursor around the image, you will see the coordinates and altitude of the point under the cursor displayed.

There are only two manipulations that you can use on the map. The one you should use first if applicable is Make Lake. This will add the blue color recognized by the Import Bitmap function as water. To add a lake, click on the Make Lake button then click on a pixel that is part of the Lake. The pixels adjacent which have the same elevation will be filled with the blue color. Note that I am not using a very good flood fill algorithm. If you click at the top of the body of water, the fill will go faster, otherwise it can take a very long time.

The other manipulation is the conversion of the continuous gray tones in the map to the distinct grays that are recognized by the Import Bitmap function as SP hill levels. This is accomplished by setting the maximum altitude for Levels 0, 1, and 2 (anything higher than 2 is 3) and clicking the Convert button. The limits are set up to give a reasonable conversion for the entire map, but you may want change them to eliminate levels for flat terrain or tailor the limits to the portion of the map that you will be using. You can change these limits repeatedly so this is not a one shot affair.

Once you have a suitable conversion, you can Save Bmp. You will probably want to manipulate this bitmap with a paint program to rotate to an orientation that works best for your scenario and to crop to the size that you want. You can also splice together two bitmaps using the paint program if you are unlucky enough to have the area that you want in more than one quadrangle. A 200x160 image converted to SP map with the 2x2 setting in the Import Bitmap function will give a close match to the 50 yard hexes of SPWAW.

Copy and Paste
A copy-paste feature for moving rectangular sections of a map from one place to another or between maps is available. This can be done using a file or the windows clipboard. To start, make a note of the upper left and lower right coordinates of the area that you wish to duplicate. Choose either Tools|Copy to File or Tools|Copy To Clipboard. Enter the coordinates in the edit boxes (a click to define feature may be added later), then click the Copy button. If you are copying to a file you will be prompted for a save file. The information is saved in text format if you want to see (or edit) it.

Once a map section is copied to the clipboard or a file, use the Tools|Paste from File/Clipboard functions to copy the map section back to the same or a different map. Only the Top-Left coordinates are needed as the entire section is pasted. When copying map sections you should only copy from even rows to even rows (y=0,2,4 etc) or odd rows to odd rows.

Copy and paste can be useful for making a sequence of overlapping maps or for rescuing a map for which you did not allow enough room on one side for all that needs to be placed there.

Using the Strategic Map
If you select Options|Strat Map, a small map showing some of the terrain features of the entire map will be displayed. The main purpose of this map is to help navigate around the large map display. Clicking on the Strat Map will display the area clicked in the main map window.

Tile Transfer
Selecting Options|Tile Transfer or the Tranfer Tiles button (with the red arrow) brings up a new window. Using this window, the icons in a terrain shp file can be viewed and transferred to the map. Set the "F" edit to the terrain file number that you want. You can get a list of the available terrain files by pressing the Index button. Selecting a terrain type in the list will transfer its file number to the F edit. (The terrain file list was kindly provided by Nick Papp, Art and Graphics Director for SPWAW.) Click Load and after a few seconds the icons in the file will appear in the box on the right. Clicking on one of the images there will select that icon. The number of the selected icon is displayed next to the file number and is show between black lines in the display.

The selected icon can be placed on the map. The location where the tile appears is determined by the "Sect" edit box. This can be set from 2 to 6. Basically, these are the layers which are sequentially painted by Steel Panthers. Some of these layers may serve special purposes that are meaningful to game play. Layers seem to be used as follows: 2=main terrain tile, 3=streams, 4=dirt roads, 5=paved roads/buildings, 6=trees. By removing the check mark in front of the numbers at the top right of the map window you can get WAW Map to omit drawing that layer when it redraws the map. To place the selected tile on the map, RIGHT click on the hex where you want it. (Be sure to set the section first.)

Even though an icon appears on the map, the properties of the hex as stored in Section 8 may need to be adjusted. Use the Inspection Window to do this. The Inspection Window has buttons to copy and paste S8 data from one hex to another. For example, if you add trees to a hex, you can select another hex on the map that already has trees, click the S8 Copy button then select the hex with the new trees and click the paste button. (When you do this, permanent changes are made and it is not necessary to press the Retain button).

Saving a Map Image
A portion (about 1/4) of the map picture can be saved as a JPEG format file. Under Files choose Save Map Image. This will save an image of the map from the current top-left hex to the hex at x+50 and y+40 to the file of your choice. The quality (and size) of the jpeg file can be adjusted before saving by using the Files|Image Quality option. These are sizable images so I have only made it possible to save 1/4 of the map at a time. If you need a complete map, you can save the four pieces and paste them together with an image editor. Hexes outlines and the layers (shown along the right) can be included or excluded just as they are in the on screen map. You may get a JPEG error message. This is probably because the image has too much data. Try a lower Quality.

Getting a Printable Map
After loading a map, under the Tools menu item you can choose Contour Map. This will pop up a new window. Hitting the Show button will draw a map with the altitude color coded. If you wish to add terrain features such as roads, trees etc, mark the Terr. checkbox and press Show again. The map as it appears on the screen can be saved to a file either in standard bmp or jpg format by pressing the Save key. That image has been sized to fit a 1024x768 screen. You might also want to print the map this map to help in deploying units. (Eventually, this map might be used in conjunction with WAW Ed for placing toops.)

If you wish to customize the appearance of the contour map, graphics are taken from the grid.bmp image. The first 2 rows are the colors used for elevations starting at -5 and increasing to +34 (a blank row can be used to extend this further if it's ever needed).

The 4th row holds icons for various terrain feature. These are added to the map in a transparent mode so the underlying color shows through. (Transparent color is determined by the lower-left pixel). The terrain features are as follows:
1. Field
2. Slope (left blank)
3. Tree
4. River
5. Wood Building
6. Stone Building
7. Dirt Road
8. Paved Road
9. Wood Bridge
10. Stone Bridge
11. Swamp
12. Lake
13. Rough
14. Hole
15. Trench
16. Trench

Road Connections

Road construction in SPWAW is fast and convenient and the editing in WAW Map is not meant to replace it. Its main functions are to remove roads that would be difficult to remove in SPWAW without removing other terrain features and to give precise control over where the road is created. SPWAW uses a two tiered approach to making roads. First is a designation as to a type of terrain that shows up when you pass the cursor over the hex. Next is the connection to roads in neighboring hexes (connectivity). Each type of road (Paved, Secondary and Railroad) has its own set of connections. All of this leads to some complexity in handling the editing of roads. Note: connectivity controls only the drawing of the roads. Movement is based on the terrain type. Thus it is possible to have an "invisible" road by giving the terrain the road characteristic but not making any connections! The graphics for drawing roads are not stored in the map file but are generated "on the fly" by SPWAW. This is consistent with SP3 but is different from SP1 and SP2.

The road editing functions are available under Roads in the main menu. First of all you can view all of the road connections using the Show All Road Connections. This will draw red lines connecting the hexes wherever there is a road connection. In addition, a colored dot will be shown in the center of a hex which reflects the type of road: paved gray, secondary orange, railroad blue. It is possible for a hex to have more than one road type, but only one at a time will be visible. Road connections can be viewed for a single type of road. Choose Show Road Connections and one of the road types at the bottom of the list. Secondary is selected automatically when choosing Show Road Connections.

The connectivity and road types are edited using the toggle functions. If you choose Toggle Road you will see the dot in the center of each hex that has the type of road selected in lower part of the menu. If you click on the dot, the dot will disappear and the road type will be removed from the hex description. Alternatively, if you click on a hex that doesn't have the dot, the dot will appear and the road type will be added to the hex description. Remember, it is the road type that controls the movement cost for the hex.

You can also control the road connectivity using the Toggle Road Connection function. This requires two clicks. Start by clicking a hex that has the connection you want to remove. Then click the adjacent hex to which you want the connection removed. You will probably want to remove the connection in the second hex also, so click on that hex and then the first hex. If there is no connection existing, clicking on a hex and an adjacent one will establish a connection. As already noted, the connectivity only (as far as I can see) controls the graphics not the movement cost. This is different from other SSI games notably the 5-star series and other "General" games.

These toggle functions stay active until they are selected again from the menu (unchecked). If you keep an eye on the position info in the lower left you will see a Click # message will these functions are active. Remember that you need to do both toggle operations to and or remove a road.

(Note: There is quite a bit of map redrawing going on when the edit functions are used. I have a 450 MHz AMD cpu and a fast graphics card and it isn't causing me a problem. If you have lots of flicker and delays, let me know; or buy some new equipment. It's fun :-) )

Plans for WAW Map and Contacting Me
Here are some things I might do. Because the maps are complex, these will be quite difficult to do but I think they are possible.
- Make some new graphics to make decent looking N-S hills.
- Add terrain features including Roads/Rivers from color coded sketches
- Convert between Desert/Summer/Winter terrain
- Add random terrain features to blocks
- Import/Export SPWW2 maps
- Your favorite feature
What gets done depends on how much interest there is in WAW Map. If it appears that no one is using it, this is it. If I hear that you like the program I'll work more on it. If there is something that would make the program especially useful for you, then let me know what it is.

This version of WAW Ed is most certainly 100% freeware but I will always accept donations. I also will welcome any suggestions for what would constitute useful features to be added. There are some problems in interface right now and until things move along these will probably not be addressed. Getting rid of unwanted graphics, keeping track of directories etc should happen as the program evolves.

Fred Chlanda
chlanda@hotmail.com
freds.webprovider.com
June 2000