• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Miihkali

Old Guard
6 Badges
Apr 11, 2007
2.979
25
  • Crusader Kings II
  • Darkest Hour
  • For The Glory
  • Rome Gold
  • Rome: Vae Victis
  • 500k Club
There are many people who are interested in map-modding and asking how to do this or that. Hannibal’s Guide for HoI2 Map Editor used to help beginners, it is located on the old HoI2 forum. So here's my attempt to provide a tutorial to map-modding. Please comment this and offer suggestions. I will edit them into the first post.

The first thing any map-modder ought now is that it won't be easy. Or actually, map-modding itself is easy, but it is also extremely boring, time-consuming, and committing mistakes causing CTD is almost inevitable. (Also, large-scale map-modding used to be very difficult, but it is not so anymore, thanks to improved tools as well as some changes that were made in the DH engine. For example, there's no need to worry about connections between provinces. They are added and deleted automatically.)

Part 1 – The preparations​

A few programs are required to mod maps. First, you need Jamie's Map Utility, as well as Microsoft Net Framework 3.5. You also need either Photoshop or GIMP in order to edit the map files.

Part 2 – Using Jamie’s Map Utility​

After you have installed Jamie's Map Utility you need to make some settings. There is some kind of a guide included in the Map Utility directory. Copy-paste the files contained in the HoI folder to the main directory of Map Utility. Then open settings.txt and give a proper gamepath.

Then launch MapExtractor.exe. This will make a copy of your game's map-files, in .png format!

After this you should move all the extracted map files in the same folder as the MapMaker.exe.

Note: As a security procedure it would be wise to make copies of the png-files you intend to change.

Part 3 – The PNG Files​

As you will see, there are four versions of each .png file. They are called borders, ProvID, colorscales, and tiles. Borders are only visible on a border between two nations. Tiles are used mainly for rivers. Colorscales file shows what you see in the game: the map itself with province borders, land and sea, names, and so on.

ProvID is a bit more complicated. Each province ID is colour-coded, i.e. certain RGB value stands for certain province. There's a file called ids.csv located in the main folder of Map Utility. It includes a complete list for provinces and their RGB values.

So let's assume you had a map comprising of just one huge province. You would colour the whole map with the RGB value that stands for province #1. Then you would add an island, province #2. And so on. After finishing the ID map you create a corresponding colorscale file. The easiest way to do this is to have a multi-layered map file. One layer for province IDs, one for colorscales, and so on.

Here you can see an quick example.

2q207js.png

The bottom of the picture shows the ID map, while on the top I have drawn black borders and coloured the provinces grey.

Part 4 – PNG & Bit Depth​

All map files must be in png format, but in few different bit depth:

a) ID layer - 24 bits
b) colorscales - 8 bits
c) borders - 32 bits
d) tiles - 32 bits

If you set them wrong, the Map Utility will crash.

This is how and in which application I save all map files. I had some problem with correct file formats when I've bought new computer and changed OS from Windows XP 32-bits to Windows 7 64-bits.

1. I draw every layer in Photoshop. Then I save all files in Photoshop as png 32-bit. Note that tiles and borders layers must have transparent background. After this step both tiles and borders are finished. ID and colorscales must be still converted, unfortunately Photoshop doesn't allow us to save those files in correct format.

2. ID layer - I use paint.net application. To save those layers in correct format you need to open your ID layer files and then follow these steps:
File --> save as --> 24-bit png

3. Colorscales -I use Infraview application. To save those layers in correct format you need to open your colorscales files and then follow these steps:
Image --> Convert to Grayscale
+
Image --> Negative
+
File --> Save (original folder)
(In result you'll see file mostly in black, with white and gray lines. For some reason on my new computer (Win 7 64-bits) it works like that while on my old comp (Win XP 32-bits) I didn't have to use negative option so If your map will be too dark, don't convert to Negative.)

Part 5 – Creating the new Map Files​

After you have finished your PNG's it's time to compress them into a format DH engine can read. Run MapMaker.exe and follow the instructions. It will do most of the job, so you are just required to press enter from time to time. If there's something wrong with your PNG files, the MapMaker will usually let you know. The most common problem is a pixel with a RGB value that is not included in the province list.

MapMaker will create a new folder called "map". Copy-paste its contents to the DH directory (remember to backup the original map folder) and launch DH. Remember to choose the right mod.

Part 6 – Province Names​

HoI2 used TrixiePlain font for province names, while DH uses Calluna. You can download both for free. Let Google help you.

In the config folder there's a file called province_names.csv. Specify a name (preferably the same you have typed on the map) for each province ID you edited.

Province names shown on map cannot be made scenario-sensitive.

(I will expand this later. If you want to write more about certain aspects of map-modding, please do so. I will include your text in the first post.)
 
Last edited:
  • 1
Reactions:
Edit: Specific question: If I have an unidentified RGB error, where do I add that id/rgb? I can't figure out where any provinces are associated with rgbs!

I used this and successfully made a tiny province modification, so far. Note that HannibalBarca's guide has a bunch of broken imageshack links.

A fuller explanation of all the things you need to do to successfully add a province and not have the game spazz out would be helpful; Which province text files do I need to change, for instance?

Do you have a suggested workflow so I don't have to take ten minutes every time I want to check if a map change worked correctly?

Last question: Any way we can look at the DH map (Map_1)? I've tried to extract it and get only crashes. Anything special required to replicate the special provinces like Iwo Jima?
 
Last edited:
In case someone is still looking to make map changes I would suggest that a lot of information here and in other pages have changed...technology has moved on, operating systems changed, etc...
What I found working for me using CS2, Paint.Net and Ultimate Paint:
1) colorscales
a) make your changes in 8bit RGB in CS2
b) convert to indexed mode but do NOT save
c) copy paste into original unchanged image in CS2 and save
d) use Ultimate Paint to add alpha, save (do not save as or convert mode using Ultimate Paint)

2) borders
a) make all changes in CS2, save as 32 bit RGB

3) Provnce
a) make all changes in CS2, save as 32 bit RGB
b) Use Paint.net to save as 24 bit.