Skip to content

Stratkit MapMaker Shape Editor

The Map Structure Editor is a 2D/3D editor in which the shape of the maps is designed, as well as capital positions, connections and seapoints. To speed this process up tremendously, the user can import SVGs which are (already) created by graphic artists/designers and directly generate the landmass (province polygons) with a single click. The editor stores the information in a GraphcalInfo asset format which is used by the MapMaker.


Please note that the Map Shape Editor is using the experimental package Vector Graphics 2.0.0 preview21 installed from git url using com.unity.vectorgraphics. Please also note that the editor is not going to work out of the box with current maps unless they are structured in the way the code expects. i.e. All points lie on top of each other and provinces in the SVG file are structured as expected in the code. SVG format is documented here: https://bytrolabs.atlassian.net/wiki/spaces/E2/pages/4074340417/SVG+Structure+and+Map+Shape+Editor+parsing

To use the Map Shape Editor, from the MapMakerUI in Unity Editor press Edit Map Shape button near GraphicalInfo entry.


Importing country flags

Import Balancing and Import All can resolve flags from staged images. The importer compares them with sprites in the configured flags atlas, reuses matches, and imports new images.

Setup

In the map's MapGenerationConfig, configure:

  • Flags Sprite Atlas: atlas to search and repack.
  • Flags Balancing Data: optional flag assignments asset. If unset, the importer uses the first IconAtlasedPropertyScriptable in player balancing data.
  • Flag Import → Raw Flags Staging Folder: root for incoming images. Do not pack this folder into an atlas.
  • Flag Import → Flags Destination Folder: root for new images. Include it in the flags atlas.
  • Flag Import → Target Flag Sprite Resolution: (width, height) used to normalize images for visual comparison. Defaults to (64, 40); set this to match the project's flag sprite resolution.
  • Duplicate Similarity Threshold and Max Candidates Per Flag: review threshold and candidate limit (defaults: 99.5 and 8).

Automated import runs only when an atlas and both folders are configured. Otherwise, the importer uses its legacy lookup by the JSON flagFileName.

Workflow

  1. Put each image at <staging>/<map id>/<flagFileName>. The map ID comes from the JSON asset name without _map (for example, 13_3_map.json uses 13_3). The staging root itself is also searched. The filename must exactly match the player's flagFileName in the JSON.
  2. In Map Shape Editor, assign the JSON asset and choose Import Balancing or Import All.
  3. The importer first skips players that already have a flag assignment. For the others, it checks for pixel-identical sprites in the configured atlas. If none is found, it scales images to the configured target resolution before visual comparison; matches at or above the threshold require a choice in the review window. With no match, the image is imported as a new sprite.
  4. Confirming review moves new images to <destination>/<map id>/, names them from the nation token (for example, flag_the_german_empire_T_UI.png), and repacks the atlas. Reused flags are written to balancing data; staged files that were actually matched to an atlas sprite are deleted after the balancing data is saved. Cancelling review aborts the import.

Map Maker creates a new map by copying its configured template. The Create New Map flow clears the copied flag assignments and assigns that flags asset to the new map, so its first JSON import can fill them. Duplicating an existing map retains its flags. On later imports, already assigned flags are preserved; clear an assignment to resolve that player's staged image again. Players removed from the JSON are not automatically removed from a separate flags asset.

Sprite names must be unique across the atlas; different folders do not create separate sprite-name namespaces. The importer first uses flag_<nation>_T_UI.png. If that name is already taken, it appends the map ID, for example flag_italy_13_3_T_UI.png; if that name is also taken, it adds a numeric suffix, such as flag_italy_13_3_2_T_UI.png. Similarity matches are reviewed manually, and batch mode aborts if review is required because it cannot make that choice.