Cold Path - turn-based multiplayer strategy

Hello! I have developed Map Editor for this game. This is very cool, now players can create their own maps and load them into the game!
I created it in January, and now I remembered that it would be cool to share some information about creating, because I believe that the code used in it for loading textures may be useful to someone.

All work with images is based on DrawPixels module, in which I added the code needed for the Map Editor.

About map creating

  1. User prepares some image
  2. User can modify map image. I only recommend doing this for small changes. Functionality of image editor is small and inconvenient
  3. When the user clicks on the “Autogenerate” button, the algorithm automatically colors the map so that each province has a unique color

  4. User clicks “Export”, editor creates map files
more about what happens when the export button is pressed
  1. The image is blurred. Blur is needed for the effect of distance fields
  2. The minimum possible texture size is selected for each province. The province image data is adjusted to the texture size and saved
  3. Data of each province is saved for click tracking using this module
  4. Information about each province is generated (size, position and information about whether it is water)
  5. Data is generated about which provinces are neighboring (so that player can move from one to another)
  6. A scenario is created for this map. It can be opened in the Scenario Editor to make cool scenario

About loading in game

  1. There is several atlases with prepared textures. The sizes of the images in them are different, because the game can have provinces of very different sizes

  2. When loading a map, this data is loaded: province texture, click tracking data, center offset (user can customize province center in map editor), province data
  3. How textures are set:

Loaded custom map in game:

The map editor is currently unfinished and not beautiful, but it is fully working.
I also added the ability to convert maps to in-game format. One fully working map has already been created in the map editor and moved to the game client.

Map Editor sources: GitHub - jalhund/cold-path-map-editor: Map Editor for Cold Path
Map Editor guide: Map Editor | Cold Path

8 Likes