Skip to content

Add Montreal - #2081

Merged
evanpelle merged 2 commits into
openfrontio:mainfrom
Duwibi:Montreal
Sep 22, 2025
Merged

evanpelle merged 2 commits into
openfrontio:mainfrom
Duwibi:Montreal

Conversation

@Duwibi

@Duwibi Duwibi commented Sep 21, 2025 •

Copy link
Copy Markdown
Contributor

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:

  • I have added screenshots for all UI updates
  • I process any text displayed to the user through translateText() and I've added it to the en.json file
  • I have added relevant tests to the test directory
  • I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced

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

DISCORD_USERNAME
Nikola123

@Duwibi
Duwibi requested a review from a team as a code owner September 21, 2025 19:48
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai

coderabbitai Bot commented Sep 21, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Adds 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

Cohort / File(s) Summary of changes
Assets: Montreal map data
map-generator/assets/maps/montreal/info.json, resources/maps/montreal/manifest.json
New JSON assets defining Montreal map/mini-map dimensions and three nations with coordinates, flags, names, and strengths.
Localization
resources/lang/en.json
Added map label entry: "montreal": "Montreal" under map section.
Client UI map description
src/client/components/Maps.ts
Added MapDescription entry for Montreal.
Core types and config
src/core/game/Game.ts, src/core/configuration/DefaultConfig.ts
Added GameMapType.Montreal; included in regional mapCategories; added numPlayersConfig for Montreal: [60, 40, 30].
Server playlist
src/server/MapPlaylist.ts
Added Montreal to map frequency list with frequency 6.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • evanpelle
  • scottanderson
  • Aotumuri

Poem

New shores arise on the northern plain,
Montreal joins the seasoned chain.
Flags unfurl where rivers gleam,
Three nations marked on a frosted dream.
In queues and lists it finds its role—
A fresh map stitched into the scroll.
O Canada, cue the control! 🇨🇦🗺️

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Add Montreal" is concise and directly summarizes the primary change in this pull request — adding the Montreal map and associated assets and code entries (manifest, translations, map files, and enum/config updates) as shown in the PR summary.
Description Check ✅ Passed The description clearly relates to the changeset: it states the Montreal map was added with topography and river revisions and includes checklist items and contributor contact, so it is on-topic and describes the PR's intent.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Duwibi Duwibi changed the title Montreal Add Montreal Sep 21, 2025
@Duwibi Duwibi added the Maps A new map, or adjustments to an existing map itself, its json, etc, label Sep 21, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 labels

Consider 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

📥 Commits

Reviewing files that changed from the base of the PR and between d231494 and 34c1e6c.

⛔ Files ignored due to path filters (7)
  • map-generator/assets/maps/montreal/image.png is excluded by !**/*.png
  • map-generator/generated/montreal/manifest.json is excluded by !**/generated/**
  • map-generator/generated/montreal/map.bin is excluded by !**/*.bin, !**/generated/**
  • map-generator/generated/montreal/mini_map.bin is excluded by !**/*.bin, !**/generated/**
  • map-generator/generated/montreal/thumbnail.webp is excluded by !**/generated/**
  • resources/maps/montreal/map.bin is excluded by !**/*.bin
  • resources/maps/montreal/mini_map.bin is 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 — LGTM

Frequency fits nearby regional maps.

resources/lang/en.json (1)

181-183: Translation key added — LGTM

map.montreal matches existing naming (lowercase under "map").

src/client/components/Maps.ts (1)

37-38: MapDescription entry added — LGTM

Keeps enum → label map consistent.

src/core/game/Game.ts (1)

87-88: Enum and category update — LGTM

GameMapType.Montreal added and included under mapCategories.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 — LGTM

Tuple shape and values consistent with neighbors.

map-generator/assets/maps/montreal/info.json (1)

3-11: Verify and sync Montreal map stats

manifest 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/.

Comment thread resources/maps/montreal/manifest.json Resolved

@TheGiraffe3 TheGiraffe3 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add screenshots?
There are also not many nations; it might be good to add more.

@Duwibi

Duwibi commented Sep 22, 2025

Copy link
Copy Markdown
Contributor Author

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

@Duwibi

Duwibi commented Sep 22, 2025

Copy link
Copy Markdown
Contributor Author
image

@Duwibi Duwibi self-assigned this Sep 22, 2025
@Duwibi Duwibi added this to the v26 milestone Sep 22, 2025
@evanpelle
evanpelle merged commit 3f4f5b1 into openfrontio:main Sep 22, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Oct 4, 2025
4 of 5 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Oct 15, 2025
4 tasks done
@coderabbitai coderabbitai Bot mentioned this pull request Oct 26, 2025
4 tasks done
@coderabbitai coderabbitai Bot mentioned this pull request Nov 30, 2025
4 tasks done
@coderabbitai coderabbitai Bot mentioned this pull request Dec 31, 2025
4 tasks done
@coderabbitai coderabbitai Bot mentioned this pull request Jan 10, 2026
4 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maps A new map, or adjustments to an existing map itself, its json, etc,

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants