Files
a1391cdad2 Add missing Unity .meta files and import artifacts (#6481)
* Add missing Unity .meta files, HoneyBadger import artifacts, and fix_import.py

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Remove HoneyBadger import artifacts and gitignore FBX auto-generated files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 09:21:22 -07:00
..

Province Map Generator

Tool to regenerate Eagle strategic map images with more equalized province sizes.

Setup

cd tools/map_generator
python3 -m venv venv
source venv/bin/activate  # or `venv\Scripts\activate` on Windows
pip install -r requirements.txt

Usage

Analyze Current Map

Show province sizes and identify small provinces:

python generate_map.py --analyze

Generate Equalized Map

Generate new map with more equal province sizes:

python generate_map.py --generate

This creates in output/:

  • rawGray.gz.bytes - New province ID map
  • masks/1.png - 43.png - Individual province masks
  • centroids.json - Province centroids for label positioning

Visualize Comparison

Generate side-by-side comparison of original vs equalized:

python generate_map.py --visualize

Options

  • --target-ratio 0.5 - Target minimum province size as ratio of average (default: 0.5)
  • --output-dir ./output - Output directory for generated files

Algorithm

  1. Load current province map from rawGray.gz.bytes
  2. Calculate centroid and area for each province
  3. Run weighted Voronoi relaxation:
    • Small provinces get higher weights to claim more area
    • Iteratively adjust until minimum province is >= 50% of average
  4. Generate new province boundaries
  5. Output new map files

Province Size Targets

The algorithm aims to make all provinces at least 50% of the average size. Problem provinces (currently too small):

  • Shumal (id=1)
  • Kojaria (id=39)
  • Usvol (id=33)
  • Tumala (id=35)
  • Chia (id=43)

Topology Changes

The equalization algorithm may create new province adjacencies that didn't exist in the original map. When this happens, the following updates are required:

  1. province_map.tsv - Update neighbors and neighborNames columns for affected provinces
  2. ShardokGame HexMaps - Add new attacker starting positions for each new adjacency

Known New Adjacencies (after equalization)

Province New Neighbors
Usvol (33) Laufarvia (3), Grytrand (42)
Grytrand (42) Usvol (33)
Laufarvia (3) Usvol (33)

Run python generate_map.py --check-topology to detect all adjacency changes.