Skip to content

Conversation

@TsProphet94
Copy link
Contributor

Description:

PR to add Bering Strait map. Produced using TOPO data from real world location, rivers and lakes correct to real world location. The map is slightly smaller than most so facilitates smaller FFA games or 2 team game modes.

The centre island has been increased in size to enable better warfare to capture the strategic location.

image

Image 16-01-2026 at 15 37

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:

TSProphet

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 16, 2026

Walkthrough

This pull request adds a new "Bering Strait" map to the game system. The change registers the map across multiple layers: asset metadata, language translations, game type definitions, server configuration, and map manifests with dimension and nation data for two territories.

Changes

Cohort / File(s) Summary
Map Asset Definitions
map-generator/assets/maps/beringstrait/info.json, resources/maps/beringstrait/manifest.json
Added new map asset files containing metadata: map name "BeringStrait", dimensions (1500×916 base with 16x and 4x variants), land tile counts, and nation placements for Alaska (us) and Russia (ru) with coordinates
Game Type & Enum
src/core/game/Game.ts
Added BeringStrait to GameMapType enum and included it in mapCategories.regional
Map Registry
map-generator/main.go
Registered "beringstrait" in the maps registry slice
Language Translation
resources/lang/en.json
Added "beringstrait": "Bering Strait" under the map object
Server Playlist
src/server/MapPlaylist.ts
Added map frequency entry for BeringStrait with value 4

Sequence Diagram(s)

(omitted — changes are data/enum/registry additions without new multi-component control flow)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

❄️ A frozen line on a glowing chart,
Two flags placed like a work of art,
Bytes map ice where currents part,
New land added, a subtle start. 🌊

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Adds Bering Strait map' clearly and concisely summarizes the main change—introducing a new map to the game.
Description check ✅ Passed The description is directly related to the changeset, explaining the map's real-world TOPO data basis, size characteristics, and strategic gameplay features.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.



📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 988217c and 9c21bb7.

📒 Files selected for processing (1)
  • resources/maps/beringstrait/manifest.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • resources/maps/beringstrait/manifest.json

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@resources/maps/beringstrait/manifest.json`:
- Line 1: The manifest.json in the Bering Strait map is improperly formatted
(Prettier failed) — open the manifest.json file and reformat it to valid, pretty
JSON (ensure proper braces, commas and indentation), then run Prettier to
rewrite the file (e.g., with npx prettier --write on the manifest file) and save
the changes so the CI Prettier check passes.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b2ba37e and 988217c.

⛔ Files ignored due to path filters (4)
  • map-generator/assets/maps/beringstrait/image.png is excluded by !**/*.png
  • resources/maps/beringstrait/map.bin is excluded by !**/*.bin
  • resources/maps/beringstrait/map16x.bin is excluded by !**/*.bin
  • resources/maps/beringstrait/map4x.bin is excluded by !**/*.bin
📒 Files selected for processing (7)
  • map-generator/assets/maps/beringstrait/info.json
  • map-generator/main.go
  • resources/lang/en.json
  • resources/maps/beringstrait/manifest.json
  • resources/maps/beringstrait/thumbnail.webp
  • src/core/game/Game.ts
  • src/server/MapPlaylist.ts
🧰 Additional context used
🧠 Learnings (7)
📚 Learning: 2026-01-12T21:37:01.156Z
Learnt from: FloPinguin
Repo: openfrontio/OpenFrontIO PR: 2874
File: src/server/MapLandTiles.ts:7-11
Timestamp: 2026-01-12T21:37:01.156Z
Learning: In this repository's OpenFrontIO deployment, inter-service HTTP calls to the master should target http://localhost:3000 (master at port 3000) as the canonical address. Apply this as the standard for all server-side TypeScript code that communicates with the master. Avoid hardcoding non-master URLs; centralize the master address (e.g., via config or env) when possible, and ensure internal service communication uses localhost:3000 in this architecture.

Applied to files:

  • src/server/MapPlaylist.ts
  • src/core/game/Game.ts
📚 Learning: 2025-08-10T14:37:35.777Z
Learnt from: TheGiraffe3
Repo: openfrontio/OpenFrontIO PR: 1770
File: resources/maps/world/manifest.json:279-355
Timestamp: 2025-08-10T14:37:35.777Z
Learning: The OpenFrontIO World Map includes both real-world nations and fictional/creative entities like "Polar Bears" as playable nations. These special nations may use non-two-letter flag codes (e.g., "polar_bears" instead of a two-letter code), and this is intentional design. The corresponding flag assets are stored in resources/flags/ with matching filenames.

Applied to files:

  • map-generator/assets/maps/beringstrait/info.json
  • resources/maps/beringstrait/manifest.json
📚 Learning: 2025-08-19T11:00:55.422Z
Learnt from: TheGiraffe3
Repo: openfrontio/OpenFrontIO PR: 1864
File: resources/maps/arabianpeninsula/manifest.json:13-170
Timestamp: 2025-08-19T11:00:55.422Z
Learning: In OpenFrontIO, nation names in map manifests are displayed directly in the UI without translation. They do not need to be added to resources/lang/en.json or processed through translateText(). This is the established pattern across all existing maps including Europe, World, Asia, Africa, and others.

Applied to files:

  • resources/lang/en.json
  • resources/maps/beringstrait/manifest.json
📚 Learning: 2025-08-27T08:12:19.610Z
Learnt from: mokizzz
Repo: openfrontio/OpenFrontIO PR: 1940
File: resources/lang/en.json:763-766
Timestamp: 2025-08-27T08:12:19.610Z
Learning: In OpenFrontIO, some country entries in src/client/data/countries.json may have similar names but different codes (e.g., "Empire of Japan" vs "Empire of Japan1"). Each unique code requires its own translation key in resources/lang/en.json after normalization. Always verify against countries.json before suggesting removal of translation keys.

Applied to files:

  • resources/lang/en.json
📚 Learning: 2025-07-12T06:35:10.457Z
Learnt from: Aotumuri
Repo: openfrontio/OpenFrontIO PR: 1357
File: resources/lang/ja.json:0-0
Timestamp: 2025-07-12T06:35:10.457Z
Learning: In OpenFrontIO project, "giantworldmap" is the correct localization key name for the giant world map, used consistently across all language files and TypeScript code. Do not suggest renaming this key.

Applied to files:

  • resources/lang/en.json
  • src/core/game/Game.ts
📚 Learning: 2025-10-27T08:59:47.620Z
Learnt from: TheGiraffe3
Repo: openfrontio/OpenFrontIO PR: 2306
File: src/core/game/Game.ts:141-141
Timestamp: 2025-10-27T08:59:47.620Z
Learning: In OpenFrontIO, gamemode-specific map variants that have altered geography from their real-world counterparts should be categorized as "fantasy" rather than "regional", even if based on real locations. Example: BaikalNukeWars is in "fantasy" because it has different islands than real Baikal.

Applied to files:

  • src/core/game/Game.ts
📚 Learning: 2026-01-13T20:16:05.535Z
Learnt from: FloPinguin
Repo: openfrontio/OpenFrontIO PR: 2887
File: src/core/execution/NukeExecution.ts:118-122
Timestamp: 2026-01-13T20:16:05.535Z
Learning: In code paths that return a Player-like object, prefer returning a union type (Player | TerraNullius) instead of undefined. When a function may fail to find a player, return TerraNullius for the 'not found' case and a Player for valid IDs, and check .isPlayer() (or equivalent) directly on the result instead of guarding with undefined or optional chaining. This should be enforced in Game, GameImpl, and GameView (and similar accessors) to avoid undefined checks and simplify null-safety handling.

Applied to files:

  • src/core/game/Game.ts
🪛 GitHub Actions: 🧪 CI
resources/maps/beringstrait/manifest.json

[warning] 1-1: Code style issues found in the file. Run 'prettier --write' to fix.


[error] 1-1: Prettier formatting check failed (exit code 1). Run 'npx prettier --write .' to fix.

🔇 Additional comments (8)
src/server/MapPlaylist.ts (1)

66-66: Looks good for playlist frequency.

The new entry fits the existing mapping and should work as-is.

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

120-120: Enum addition is clean and consistent.

No issues with the new map type entry.


168-168: Regional category update looks correct.

Placement matches the intended map grouping.

map-generator/main.go (1)

31-31: Map registry entry is correct.

This aligns with the new assets and should enable generation.

resources/lang/en.json (1)

289-290: Translation key looks good.

The key format matches existing map entries and should be picked up by the UI.

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

1-14: No action needed—nation coordinates use the correct established schema.

The "coordinates" key is used consistently across all existing info.json files in the repository (40+ maps verified). BeringStrait follows the same pattern. The generator reads nation data as dynamic JSON without strict key validation, so there is no risk of data loss from a key name mismatch.

resources/maps/beringstrait/manifest.json (2)

18-35: LGTM! Nation definitions follow the correct pattern.

The nation entries for Alaska and Russia are well-structured with valid flag codes (us, ru) and coordinates that fall within the map boundaries. Based on learnings, nation names are displayed directly without requiring translation, which is the established pattern.


2-16: Map dimensions and tile counts look reasonable.

The scaled versions (map16x, map4x) have dimensions and land tile counts that are consistent with downscaling from the base map. The slight variations in tile ratios are expected due to interpolation during the scaling process.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@ryanbarlow97 ryanbarlow97 added this to the v30 milestone Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants