Project

Plugin for Godot | Grand Strategy Map Editor

A Godot 4.5 GDExtension that provides editor tools for interacting with Europa Universalis provinces and country data as well as a shader pipeline that renders a map with smooth borders.

Plugin for Godot | Grand Strategy Map Editor Preview

📚 Project Article

I like writing articles on the topics I worked on. It makes me feel I can help others learn about the topic and it. The one below describes how the rendering works at a basic level. Making a Grand Strategy Map Editor Plugin for Godot in C++

📂 Source Code

Can be found here.

🛠️ Features

  • Smooth borders using HQX shader
  • Compute abstraction for generating color_map, lookup_color and political_mask
  • Export/import functionality based on Europa Universalis 4 format
  • Custom Inspector window for editing country data

⚙️ My Contributions

Rendering Pipeline

I used the technique described in this paper to implement basic rendering for each of the countries, which can change at runtime their provinces. Broadly speaking, it involves using two textures(UV coordinates and one with color values) as an indirection in the fragment shader. One of them defines the UV coordinates to the other texture, therefore, a province is mapped to a pixel and changing that particular pixel will change the province color.

Pipeline diagram Complete overview of the rendering pipeline from province map to final output

Simple political map Basic political map outputting province colors without borders

Border Rendering

There are many ways to do border rendering. One can generate meshes, use vector based splines or image based techniques. The latter is one of the simpler ones that I implemented, it has artifacts in certain . The political map from the Rendering Pipeline is used in conjunction with a mask and Signed Distance Field texture to create low resolution borders. Afterwards a HQX shader is applied to create a smooth appearance.

Upscaled map result Map upscaled using HQX shader for smoother appearance

Editor Functionality

In this project I also learned how to extend the editor in Godot. Below you can see how the user can change owenership of provinces, or their country color through the editor I made. The changes are saved in the file format that Europa Universalis 4 uses.