Skip to content

Add Two Lakes - #2743

Merged
evanpelle merged 1 commit into
openfrontio:mainfrom
Duwibi:TwoLakesMap
Dec 30, 2025
Merged

evanpelle merged 1 commit into
openfrontio:mainfrom
Duwibi:TwoLakesMap

Conversation

@Duwibi

@Duwibi Duwibi commented Dec 30, 2025 •

Copy link
Copy Markdown
Contributor

Description:

This PR adds the Two Lakes map, based on the irl area around lake Ohrid and lake Prespa

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 December 30, 2025 15:45
@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 Dec 30, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

This PR adds a new "Two Lakes" map to the game by creating map data files, registering it in the map-generator, adding localization, and updating configuration files to include the map type, player counts, and playlist frequency.

Changes

Cohort / File(s) Summary
Map Data Files
map-generator/assets/maps/twolakes/info.json, resources/maps/twolakes/manifest.json
New data files defining the Two Lakes map with dimensions, tile counts, and five nation spawn points with coordinates.
Map Registration
map-generator/main.go
Added TwoLakes entry to the maps registry list.
Localization
resources/lang/en.json
Added translation key map.twolakes with display name "Two Lakes"; fixed syntax by adding trailing comma to lemnos entry.
Game Type Definition
src/core/game/Game.ts
Added TwoLakes enum value to GameMapType; registered TwoLakes in the regional map category.
Game Configuration
src/client/components/Maps.ts, src/core/configuration/DefaultConfig.ts, src/server/MapPlaylist.ts
Added TwoLakes to MapDescription record, numPlayersConfig with values [60, 50, 40], and map frequency set to 6.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • #2280: Adds new map "Achiran" with identical code-level changes across GameMapType, manifest files, configuration, and localization
  • #2542: Adds new map with matching changes to GameMapType enum, MapDescription, DefaultConfig, MapPlaylist, and resources
  • #1517: Earlier map addition following the same analogous registration pattern across all the same locations

Suggested labels

Feature - Map, Maps

Suggested reviewers

  • evanpelle
  • TheGiraffe3

Poem

Two lakes now shimmer on the battlefield,
Where warriors gather, their fate to yield,
Five nations spawn where waters meet,
New strategic ground, the game complete! 🌊⚔️

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add Two Lakes' clearly and concisely summarizes the main change: introducing a new map called Two Lakes to the codebase.
Description check ✅ Passed The description explains that the PR adds the Two Lakes map based on the real-life area around Lake Ohrid and Lake Prespa, which directly relates to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 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 4f3d9df and c8e9346.

⛔ Files ignored due to path filters (4)
  • map-generator/assets/maps/twolakes/image.png is excluded by !**/*.png
  • resources/maps/twolakes/map.bin is excluded by !**/*.bin
  • resources/maps/twolakes/map16x.bin is excluded by !**/*.bin
  • resources/maps/twolakes/map4x.bin is excluded by !**/*.bin
📒 Files selected for processing (9)
  • map-generator/assets/maps/twolakes/info.json
  • map-generator/main.go
  • resources/lang/en.json
  • resources/maps/twolakes/manifest.json
  • resources/maps/twolakes/thumbnail.webp
  • src/client/components/Maps.ts
  • src/core/configuration/DefaultConfig.ts
  • src/core/game/Game.ts
  • src/server/MapPlaylist.ts
🧰 Additional context used
🧠 Learnings (13)
📚 Learning: 2025-10-26T15:37:07.732Z
Learnt from: GlacialDrift
Repo: openfrontio/OpenFrontIO PR: 2298
File: src/client/graphics/layers/TerritoryLayer.ts:200-210
Timestamp: 2025-10-26T15:37:07.732Z
Learning: In GameImpl.ts lines 124-139, team assignment logic varies by number of teams: when numPlayerTeams < 8, teams are assigned ColoredTeams values (Red, Blue, Yellow, Green, Purple, Orange, Teal); when numPlayerTeams >= 8, teams are assigned generic string identifiers like "Team 1", "Team 2", etc., which are not members of ColoredTeams.

Applied to files:

  • src/core/configuration/DefaultConfig.ts
📚 Learning: 2025-12-26T22:21:15.466Z
Learnt from: FloPinguin
Repo: openfrontio/OpenFrontIO PR: 2689
File: src/client/PublicLobby.ts:245-245
Timestamp: 2025-12-26T22:21:15.466Z
Learning: In public lobbies with HumansVsNations mode in src/client/PublicLobby.ts, maxPlayers represents only human player slots (already halved in DefaultConfig.ts). The nation NPCs are added automatically server-side and don't count toward maxPlayers. Therefore, getTeamSize correctly returns maxPlayers directly for HumansVsNations to display the proper team size (e.g., maxPlayers=5 yields "5 Humans vs 5 Nations").

Applied to files:

  • src/core/configuration/DefaultConfig.ts
📚 Learning: 2025-10-20T20:15:28.858Z
Learnt from: sambokai
Repo: openfrontio/OpenFrontIO PR: 2225
File: src/core/execution/FakeHumanExecution.ts:51-51
Timestamp: 2025-10-20T20:15:28.858Z
Learning: In src/core/execution/FakeHumanExecution.ts, game balance constants like MIRV_COOLDOWN_TICKS, MIRV_HESITATION_ODDS, VICTORY_DENIAL_TEAM_THRESHOLD, VICTORY_DENIAL_INDIVIDUAL_THRESHOLD, and STEAMROLL_CITY_GAP_MULTIPLIER are experimental tuning parameters subject to frequent change during balance testing. Do not flag changes to these values as issues or compare them against previous values.

Applied to files:

  • src/core/configuration/DefaultConfig.ts
📚 Learning: 2025-08-12T00:31:50.144Z
Learnt from: scottanderson
Repo: openfrontio/OpenFrontIO PR: 1752
File: src/core/game/Game.ts:750-752
Timestamp: 2025-08-12T00:31:50.144Z
Learning: In the OpenFrontIO codebase, changes to the PlayerInteraction interface (like adding canDonateGold and canDonateTroops flags) do not require corresponding updates to src/core/Schemas.ts or server serialization code.

Applied to files:

  • src/core/configuration/DefaultConfig.ts
📚 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/maps/twolakes/manifest.json
  • resources/lang/en.json
  • map-generator/assets/maps/twolakes/info.json
📚 Learning: 2025-08-16T10:52:08.292Z
Learnt from: TheGiraffe3
Repo: openfrontio/OpenFrontIO PR: 884
File: resources/lang/en.json:456-461
Timestamp: 2025-08-16T10:52:08.292Z
Learning: In OpenFrontIO, translation files in resources/lang/*.json (except en.json) should not be updated in regular PRs. Only dedicated translation PRs titled "mls" and made by Aotumori should update non-English locale files. Regular PRs should only update en.json when adding or modifying translation keys.

Applied to files:

  • resources/lang/en.json
📚 Learning: 2025-06-02T14:27:37.609Z
Learnt from: andrewNiziolek
Repo: openfrontio/OpenFrontIO PR: 1007
File: resources/lang/de.json:115-115
Timestamp: 2025-06-02T14:27:37.609Z
Learning: For OpenFrontIO project: When localization keys are renamed in language JSON files, the maintainers separate technical changes from translation content updates. They wait for community translators to update the actual translation values rather than attempting to translate in the same PR. This allows technical changes to proceed while ensuring accurate translations from native speakers.

Applied to files:

  • resources/lang/en.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-05-30T03:53:52.231Z
Learnt from: scottanderson
Repo: openfrontio/OpenFrontIO PR: 949
File: resources/lang/en.json:8-10
Timestamp: 2025-05-30T03:53:52.231Z
Learning: For the OpenFrontIO project, do not suggest updating translation files in resources/lang/*.json except for en.json. The project has a dedicated translation team that handles all other locale files.

Applied to files:

  • resources/lang/en.json
📚 Learning: 2025-06-02T14:27:23.893Z
Learnt from: andrewNiziolek
Repo: openfrontio/OpenFrontIO PR: 1007
File: resources/lang/he.json:138-138
Timestamp: 2025-06-02T14:27:23.893Z
Learning: andrewNiziolek's project uses community translation for internationalization. When updating map names or other user-facing text, they update the keys programmatically but wait for community translators to provide accurate translations in each language rather than using machine translations.

Applied to files:

  • resources/lang/en.json
📚 Learning: 2025-10-21T20:06:04.823Z
Learnt from: Saphereye
Repo: openfrontio/OpenFrontIO PR: 2233
File: src/client/HostLobbyModal.ts:891-891
Timestamp: 2025-10-21T20:06:04.823Z
Learning: For the HumansVsNations game mode in `src/client/HostLobbyModal.ts` and related files, the implementation strategy is to generate all nations and adjust their strength for balancing, rather than limiting lobby size based on the number of available nations on the map.

Applied to files:

  • map-generator/assets/maps/twolakes/info.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:

  • 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
🔇 Additional comments (9)
src/core/configuration/DefaultConfig.ts (1)

88-88: LGTM!

The player count configuration for TwoLakes is properly added with reasonable values [60, 50, 40] for large/medium/small lobbies, consistent with other regional maps.

resources/lang/en.json (1)

248-249: LGTM!

The localization entry for the Two Lakes map is correctly added, and the trailing comma fix on the lemnos entry ensures valid JSON formatting.

map-generator/main.go (1)

63-63: LGTM!

The map registry entry for "twolakes" is correctly added, enabling the map-generator to process the new map data.

src/server/MapPlaylist.ts (1)

60-60: LGTM!

The playlist frequency of 6 for TwoLakes is a reasonable mid-range value, placing it alongside other popular regional maps.

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

1-25: LGTM!

The map data structure is correct with 5 nations properly defined. All nation coordinates fall within the map dimensions (2100×1840), and the nation names reflect the real-world geography of the Lake Ohrid and Lake Prespa region.

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

47-47: LGTM!

The map description entry for TwoLakes is correctly added, enabling proper display of the map name in the UI.

resources/maps/twolakes/manifest.json (1)

1-40: LGTM!

The manifest structure is correct with proper map dimensions across all three resolution variants, reasonable land tile counts, and matching nation definitions from the info.json file.

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

110-110: LGTM!

The TwoLakes enum value is correctly added to GameMapType, maintaining consistency across the type system.


149-149: LGTM!

The TwoLakes map is correctly classified in the regional category, as it represents a real-world geographic area (Lake Ohrid and Lake Prespa region).


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 added this to the v29 milestone Dec 30, 2025
@Duwibi Duwibi added the Maps A new map, or adjustments to an existing map itself, its json, etc, label Dec 30, 2025
@iiamlewis

Copy link
Copy Markdown
Contributor

Can we have a picture @Duwibi

@evanpelle evanpelle left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@evanpelle
evanpelle added this pull request to the merge queue Dec 30, 2025
Merged via the queue into openfrontio:main with commit 11b2591 Dec 30, 2025
10 of 18 checks passed
@Duwibi

Duwibi commented Dec 30, 2025

Copy link
Copy Markdown
Contributor Author

Can we have a picture @Duwibi

You can take a look in the dev discord. I sent a picture in general

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