Files
OpenFrontIO/map-generator/assets/maps/northamerica/info.json
T
Evan 3de5fb4204 Move map metadata into info.json and generate map TypeScript from it (#4227)
**Add approved & assigned issue number here:**

N/A — maintainer refactor.

## Description:

Makes each map's `info.json` the single source of truth for map metadata
— adding a map is now a folder with `image.png` + `info.json`, a
`gen-maps` run, and an en.json display name.

**info.json / manifest.json carry full map metadata.** Every
`map-generator/assets/maps/<map>/info.json` declares `id` (the
`GameMapType` enum key), `name` (the enum value — wire format, unchanged
for all 94 maps), `translation_key`, `categories`, and
`multiplayer_frequency` (the public-playlist weight that used to be the
`FREQUENCY` record in MapPlaylist.ts). The generator validates
everything and mirrors it into `resources/maps/<map>/manifest.json`. 23
stale info.json `name` values were normalized to the canonical enum
value; enum values are byte-identical, so replays and stored game
configs are unaffected.

**The generator emits the TypeScript and discovers maps itself.** New
`map-generator/codegen.go` generates `src/core/game/Maps.gen.ts`
(`GameMapType`, `GameMapName`, `mapCategories`, `mapTranslationKeys`,
`multiplayerFrequency` — now a full `Record<GameMapName, number>`,
killing the old `Partial`) on every run; `Game.ts` re-exports it. The
hardcoded map registry in `main.go` is gone — maps are auto-discovered
from the `assets/maps` / `assets/test_maps` directories. MapConsistency
tests fail with a "run `npm run gen-maps`" message if info.json,
manifest.json, and Maps.gen.ts drift. The tracked
`map-generator/map-generator` binary is rebuilt to match.

**New categories: continents + world/cosmic/tournament/other,
multi-category support.** `continental`/`regional`/`fantasy`/`arcade`
are replaced by `featured`, `world`, `europe`, `asia`, `north_america`,
`africa`, `south_america`, `oceania`, `antarctica`, `cosmic`,
`tournament`, and `other`. Maps can list multiple categories, so
straddlers (Black Sea, Bosphorus, Caucasus, Between Two Seas, Bering
Sea/Strait, Mena, Strait of Gibraltar, Hawaii, Arctic) appear under both
regions. Featured is itself a category (same 7 maps as before).
MapPlaylist keeps its arcade exclusion via an explicit set.

**Map picker UI.** Two tabs: **Featured** (default — featured maps plus
a Favorites section when maps are starred) and **All** (one prominent
collapsible bar per category with a map count, collapsed by default).
The selected map is prepended to the featured grid when it lives
elsewhere. `getMapName()` resolves through the generated
`mapTranslationKeys`, which also fixes tourney maps never resolving a
valid translation key.

## Please complete the following:

- [ ] I have added screenshots for all UI updates (maintainer change —
picker described above)
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evanpelle

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 19:36:53 -07:00

356 lines
6.8 KiB
JSON

{
"id": "NorthAmerica",
"name": "North America",
"translation_key": "map.northamerica",
"categories": ["featured", "north_america"],
"multiplayer_frequency": 5,
"featured_rank": 3,
"nations": [
{
"coordinates": [1625, 1040],
"name": "Florida",
"flag": "Florida"
},
{
"coordinates": [1250, 1130],
"name": "Mexico",
"flag": "mx"
},
{
"coordinates": [1460, 1275],
"name": "Guatemala",
"flag": "gt"
},
{
"coordinates": [1530, 1290],
"name": "Honduras",
"flag": "hn"
},
{
"coordinates": [1570, 1350],
"name": "Nicaragua",
"flag": "ni"
},
{
"coordinates": [1651, 1399],
"name": "Panama",
"flag": "pa"
},
{
"coordinates": [1760, 1410],
"name": "Colombia",
"flag": "co"
},
{
"coordinates": [1883, 1395],
"name": "Venezuela",
"flag": "ve"
},
{
"coordinates": [1692, 1161],
"name": "Cuba",
"flag": "cu"
},
{
"coordinates": [331, 341],
"name": "Alaska",
"flag": "Alaska"
},
{
"coordinates": [1062, 932],
"name": "Arizona",
"flag": "Arizona"
},
{
"coordinates": [940, 905],
"name": "California",
"flag": "California"
},
{
"coordinates": [1147, 843],
"name": "Colorado",
"flag": "Colorado"
},
{
"coordinates": [1593, 974],
"name": "Georgia",
"flag": "Georgia_US"
},
{
"coordinates": [250, 1200],
"name": "Hawaii",
"flag": "Hawaii"
},
{
"coordinates": [1000, 710],
"name": "Idaho",
"flag": "Idaho"
},
{
"coordinates": [1490, 789],
"name": "Illinois",
"flag": "Illinois"
},
{
"coordinates": [1335, 835],
"name": "Kansas",
"flag": "Kansas"
},
{
"coordinates": [1525, 872],
"name": "Kentucky",
"flag": "Kentucky"
},
{
"coordinates": [1410, 984],
"name": "Louisiana",
"flag": "Louisiana"
},
{
"coordinates": [1854, 720],
"name": "Maine",
"flag": "Maine"
},
{
"coordinates": [1572, 762],
"name": "Michigan",
"flag": "Michigan"
},
{
"coordinates": [1472, 940],
"name": "Mississippi",
"flag": "Mississippi"
},
{
"coordinates": [1390, 688],
"name": "Minnesota",
"flag": "Minnesota"
},
{
"coordinates": [1427, 829],
"name": "Missouri",
"flag": "Missouri"
},
{
"coordinates": [1100, 677],
"name": "Montana",
"flag": "Montana"
},
{
"coordinates": [1263, 787],
"name": "Nebraska",
"flag": "Nebraska"
},
{
"coordinates": [946, 818],
"name": "Nevada",
"flag": "Nevada"
},
{
"coordinates": [1169, 932],
"name": "New Mexico",
"flag": "New_Mexico"
},
{
"coordinates": [1737, 768],
"name": "New York",
"flag": "New_York"
},
{
"coordinates": [1239, 670],
"name": "North Dakota",
"flag": "North_Dakota"
},
{
"coordinates": [1612, 816],
"name": "Ohio",
"flag": "Ohio"
},
{
"coordinates": [1296, 902],
"name": "Oklahoma",
"flag": "Oklahoma"
},
{
"coordinates": [873, 757],
"name": "Oregon",
"flag": "Oregon"
},
{
"coordinates": [1686, 796],
"name": "Pennsylvania",
"flag": "Pennsylvania"
},
{
"coordinates": [1636, 934],
"name": "South Carolina",
"flag": "South_Carolina"
},
{
"coordinates": [1302, 721],
"name": "South Dakota",
"flag": "South_Dakota"
},
{
"coordinates": [1579, 900],
"name": "Tennessee",
"flag": "Tennessee"
},
{
"coordinates": [1279, 1013],
"name": "Texas",
"flag": "Texas"
},
{
"coordinates": [1785, 727],
"name": "Vermont",
"flag": "Vermont"
},
{
"coordinates": [1652, 864],
"name": "Virginia",
"flag": "Virginia"
},
{
"coordinates": [897, 673],
"name": "Washington",
"flag": "Washington"
},
{
"coordinates": [1118, 764],
"name": "Wyoming",
"flag": "Wyoming"
},
{
"coordinates": [1798, 592],
"name": "Quebec",
"flag": "Quebec"
},
{
"coordinates": [1080, 367],
"name": "Northwest Territories",
"flag": "northwestterritories"
},
{
"coordinates": [1440, 319],
"name": "Nunavut",
"flag": "Nunavut"
},
{
"coordinates": [2399, 171],
"name": "Greenland",
"flag": "gl"
},
{
"coordinates": [777, 382],
"name": "Yukon",
"flag": "Yukon"
},
{
"coordinates": [787, 561],
"name": "British Columbia",
"flag": "britishcolumbia"
},
{
"coordinates": [966, 521],
"name": "Alberta",
"flag": "alberta"
},
{
"coordinates": [1172, 569],
"name": "Saskatchewan",
"flag": "saskatchewan"
},
{
"coordinates": [1343, 507],
"name": "Manitoba",
"flag": "manitoba"
},
{
"coordinates": [1575, 621],
"name": "Ontario",
"flag": "ontario"
},
{
"coordinates": [1903, 671],
"name": "New Brunswick",
"flag": "newbrunswick"
},
{
"coordinates": [1924, 748],
"name": "Nova Scotia",
"flag": "novascotia"
},
{
"coordinates": [1983, 547],
"name": "Newfoundland and Labrador",
"flag": "newfoundlandandlabrador"
},
{
"coordinates": [1793, 1209],
"name": "Haiti",
"flag": "ht"
},
{
"coordinates": [1851, 1215],
"name": "Dominican Republic",
"flag": "do"
},
{
"coordinates": [1912, 1224],
"name": "Puerto Rico",
"flag": "pr"
},
{
"coordinates": [2020, 1422],
"name": "Guyana",
"flag": "gy"
},
{
"coordinates": [2785, 358],
"name": "Iceland",
"flag": "is"
},
{
"coordinates": [1975, 702],
"name": "Prince Edward Island",
"flag": "princeedwardisland"
},
{
"coordinates": [1037, 838],
"name": "Utah",
"flag": "Utah"
},
{
"coordinates": [1402, 772],
"name": "Iowa",
"flag": "Iowa"
},
{
"coordinates": [1685, 902],
"name": "North Carolina",
"flag": "North_Carolina"
},
{
"coordinates": [1417, 904],
"name": "Arkansas",
"flag": "Arkansas"
},
{
"coordinates": [1547, 819],
"name": "Indiana",
"flag": "Indiana"
},
{
"coordinates": [1528, 963],
"name": "Alabama",
"flag": "Alabama"
},
{
"coordinates": [1811, 782],
"name": "Massachusetts",
"flag": "Massachusetts"
}
]
}