skip to Main Content

Terrain & Territory Importers

The Map Editor includes a terrain importer option located in the gear icon:

This tool can be used to import the heightmap and combined textures from a standard Unity terrain into WMSK. Clicking on the menu option brings the following dialog:

1.- Drag & drop a terrain from your scene.

2.- Select the texture resolution. Note that the heightmap always have a resolution of 2048×1024.

3.- Rotate 180 degrees. Tick this option if your terrain is rotated.

Once you click “Start”, the Earth style will be switched to “Texture” and the new texture and heightmap will be automatically assigned. These textures are stored in Resources/WMSK/Terrain folder.

You can also select other Earth styles and assign the new texture to the corresponding material found in Resources/WMSK/Materials.

Territory Importer

The Map Editor includes a territory importer option located in the gear icon:

This tool can be used to speed up the creation of entire new world maps. It works by taking a previously prepared texture and creating country or province regions based on the colors of the texture.

The texture should have a 2×1 aspect ratio (example: 2048×1024 PNG file) and should contain solid colors only, like in the picture below:

Using territory importer is quite straight-forward:

  1. Click “Open Texture-File” to select your texture file.
  2. Select a background color (this color will be ignored). Territory Importer automatically takes the color for the first pixel, but you can click on the texture to choose any other color as background.
  3. Select the creation mode (countries or provinces).
  4. Click “Generate Countries” or “Generate Provinces”.

From this point, the territory importer will start analyzing the texture and extracting regions.

Important: your current map will be replaced! You can use the texture importer safely as long as you don’t save the changes from within the Map Editor. So, you can import the same texture (modified or retouched) as many times as you want. Click “Revert” in the Map Editor to cancel and reload map frontiers from current geodata files.

In Country Mode, the territory importer will create one country per different color found in the texture. Then it will add any region of the same color to each country. Finally, it will update current provinces, cities and any created mountpoints to be associated to the new countries (for provinces, the center of the province will be checked against the new countries). Any province, city or mount point that don’t fit inside any of the new countries will be removed.

In Province Mode, the operation is very similar. Territory importer will create one province per different color and associate any region of same color to each province. Provinces usually have one region, but you could have one province split in 2 or more land regions this way. Once all provinces are created, they will be associated to the existing countries (the center of the province will be used to find a country that contains that point – if no country encloses the province center, the province will be assigned to the country set into the “Overseas Country Owner” field). Cities will be updated to reflect the new province they belong.

Note that resulting map will require some manual tweaks. Pay attention to the joints between frontiers or borders of two different regions. Use the magnet tool in the Map Editor to fix and merge frontier points.

Once you’re satisfied with the results, hit “Save” in the Map Editor to make changes persistent (it will overwrite current geodata files in Resources/Geodata folder).

The Territory Importer will store the original color of each country or province in the “ImporterColor” attribute (in case you need that info later using country.attrib[“ImporterColor”] or province.attrib[“ImporterColor”]):

Back To Top