Repository navigation
Add Montreal - #2081
Add Montreal#2081
Conversation
|
|
WalkthroughAdds a new “Montreal” map across assets, localization, client mapping, core enum/categories, default player counts, and server playlist frequency. Includes map/mini-map metadata and nations. No control-flow or logic changes beyond data/enum additions. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Player
participant UI as Client UI (Maps.ts)
participant Core as Core (GameMapType & config)
participant Server as Server (MapPlaylist)
participant Assets as Assets/Manifest
participant i18n as Localization
Player->>UI: Open map selection
UI->>Core: Read GameMapType + MapDescription (includes Montreal)
UI->>i18n: Resolve "montreal" label
Player->>Server: Request available/weighted maps
Server->>Server: Use MapPlaylist (Montreal freq=6)
Server-->>Player: Return map options (possibly Montreal)
Player->>Assets: Load manifest for Montreal
Assets-->>Player: Map/mini-map + nations metadata
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/client/components/Maps.ts (2)
127-131: Improve a11y: use translated/friendly name in(and title)
Use the same label users see, not the enum key.
Apply this diff:
- ? html`<img - src="${this.mapWebpPath}" - alt="${this.mapKey}" - class="option-image" - />` + ? html`<img + src="${this.mapWebpPath}" + alt="${this.translation || this.mapName || this.mapKey}" + title="${this.translation || this.mapName || this.mapKey}" + class="option-image" + />`
8-38: Reduce duplication: prefer translateText over hardcoded MapDescription labelsConsider deriving labels from i18n keys (e.g.,
translateText('map.' + key.toLowerCase())) and keep MapDescription only for rare overrides. This avoids drift and keeps all user text in en.json.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (7)
map-generator/assets/maps/montreal/image.pngis excluded by!**/*.pngmap-generator/generated/montreal/manifest.jsonis excluded by!**/generated/**map-generator/generated/montreal/map.binis excluded by!**/*.bin,!**/generated/**map-generator/generated/montreal/mini_map.binis excluded by!**/*.bin,!**/generated/**map-generator/generated/montreal/thumbnail.webpis excluded by!**/generated/**resources/maps/montreal/map.binis excluded by!**/*.binresources/maps/montreal/mini_map.binis excluded by!**/*.bin
📒 Files selected for processing (7)
map-generator/assets/maps/montreal/info.json(1 hunks)resources/lang/en.json(1 hunks)resources/maps/montreal/manifest.json(1 hunks)src/client/components/Maps.ts(1 hunks)src/core/configuration/DefaultConfig.ts(1 hunks)src/core/game/Game.ts(2 hunks)src/server/MapPlaylist.ts(1 hunks)
🔇 Additional comments (6)
src/server/MapPlaylist.ts (1)
42-42: Add Montreal to rotation — LGTMFrequency fits nearby regional maps.
resources/lang/en.json (1)
181-183: Translation key added — LGTM
map.montrealmatches existing naming (lowercase under "map").src/client/components/Maps.ts (1)
37-38: MapDescription entry added — LGTMKeeps enum → label map consistent.
src/core/game/Game.ts (1)
87-88: Enum and category update — LGTM
GameMapType.Montrealadded and included undermapCategories.regional. No type or control-flow side effects.Also applies to: 120-121
src/core/configuration/DefaultConfig.ts (1)
68-69: Default player counts for Montreal — LGTMTuple shape and values consistent with neighbors.
map-generator/assets/maps/montreal/info.json (1)
3-11: Verify and sync Montreal map statsmanifest and info.json disagree on num_land_tiles — confirm the correct counts and update the other file to match.
- resources/maps/montreal/manifest.json — map.num_land_tiles=1957697, mini_map.num_land_tiles=484387
- map-generator/assets/maps/montreal/info.json — map.num_land_tiles=1961549, mini_map.num_land_tiles=485392
Also sanity‑check that every nation coordinate is inside manifest.map.width/manifest.map.height and that map images exist under resources/maps/montreal/.
TheGiraffe3
left a comment
There was a problem hiding this comment.
Could you add screenshots?
There are also not many nations; it might be good to add more.
The map is 1530x1500, so I think 3 nations would be more than enough, especially when some of them are level 2. I'll add a screenshot in a second |

Description:
This PR adds the Montreal map that was used in OFM with some revisions, including adding some river and changing the overall topography.
Describe the PR.
Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
DISCORD_USERNAME
Nikola123