Skip to content

Add Map - Amazon River Wide#3464

Open
patrickbadly-hub wants to merge 7 commits intoopenfrontio:mainfrom
patrickbadly-hub:Add-Map---Amazon-River-Wide
Open

Add Map - Amazon River Wide#3464
patrickbadly-hub wants to merge 7 commits intoopenfrontio:mainfrom
patrickbadly-hub:Add-Map---Amazon-River-Wide

Conversation

@patrickbadly-hub
Copy link
Copy Markdown

Description:

Add map Amazon River Wide. The Amazon river has been widened temporarily for April Fools day to accommodate larger ships but will likely return to normal soon. Minor edit to the standard Amazon River map. Not intended to keep or replace.

Test footage. https://discord.com/channels/1284581928254701718/1483786939332169830/1483804243549749258

Discord username

PlaysBadly

add folder for amazon river wide
added sources files for amazon river wide
added amazon river wide
added amazon river wide
added amazon river wide
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c856cd94-846d-45a1-972d-566dce4a442d

📥 Commits

Reviewing files that changed from the base of the PR and between fd9c2f3 and 07562d9.

📒 Files selected for processing (3)
  • map-generator/main.go
  • resources/lang/en.json
  • src/core/game/Game.ts
✅ Files skipped from review due to trivial changes (2)
  • resources/lang/en.json
  • src/core/game/Game.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • map-generator/main.go

Walkthrough

Adds a new map "Amazon River Wide": a JSON map asset with 24 nation entries, a registry entry in the map generator, an English translation, and a GameMapType enum member added to the regional category.

Changes

Cohort / File(s) Summary
Map Asset Definition
map-generator/assets/maps/amazonriverwide/info.json
Adds static map asset containing top-level name and nations array with 24 nation objects (coordinates, name, flag set to "br"). No logic changes.
Map Registration and Localization
map-generator/main.go, resources/lang/en.json
Registers amazonriverwide in the maps registry and adds map.amazonriverwide = "Amazon River Wide" to English translations.
Game Type Enumeration
src/core/game/Game.ts
Adds AmazonRiverWide = "Amazon River Wide" to GameMapType and includes it in mapCategories.regional. No runtime logic changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🌿 A wide river sketched in JSON lines,
Twenty-four flags where the sunlight shines,
Registry, enum, and words in English too,
A new map to sail and explore anew. 🗺️

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add Map - Amazon River Wide' directly and clearly summarizes the main change: adding a new map to the game.
Description check ✅ Passed The description is related to the changeset, explaining the purpose of the new map and its temporary nature for April Fools' Day.
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.


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
Copy Markdown
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: 2

🧹 Nitpick comments (1)
map-generator/main.go (1)

75-75: Consider a temporary-event gate for this map registration

Since this map is explicitly temporary, a static registry entry can be forgotten and remain active. Consider gating event maps via config/flag so enable/disable is explicit.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@map-generator/main.go` at line 75, Temporary event map "amazonriverwide" is
being registered unconditionally; add an explicit feature gate (config flag or
CLI flag) to prevent forgotten static registrations. Introduce a boolean
config/flag (e.g. EnableTemporaryMaps or --enable-temporary-maps) and wrap the
map registration for the {Name: "amazonriverwide"} entry in a conditional that
only registers it when the flag is true; update the map registration function
(e.g. RegisterMaps or wherever the slice containing {Name: "amazonriverwide"} is
created) to check the flag, and emit a clear log message when the map is skipped
or enabled so operators can see the state.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@map-generator/assets/maps/amazonriverwide/info.json`:
- Line 46: The "name" value "Esperito Santo" in the map info entry is likely
misspelled; update the value for the "name" key in the map's info.json (the
entry currently reading "Esperito Santo") to the correct nation name, e.g.
"Espírito Santo" (or "Espirito Santo" if your codebase avoids diacritics) so the
UI displays the proper name.

In `@src/core/game/Game.ts`:
- Line 185: GameMapType.AmazonRiverWide was added to Game.ts but not included in
the frequency map used by MapPlaylist, so its weight falls back to 0 and it
never gets selected; open MapPlaylist.ts and add an entry for
GameMapType.AmazonRiverWide to the frequency object (matching the style and
numeric weight pattern used for the other GameMapType keys) so it receives a
non-zero selection weight during playlist construction.

---

Nitpick comments:
In `@map-generator/main.go`:
- Line 75: Temporary event map "amazonriverwide" is being registered
unconditionally; add an explicit feature gate (config flag or CLI flag) to
prevent forgotten static registrations. Introduce a boolean config/flag (e.g.
EnableTemporaryMaps or --enable-temporary-maps) and wrap the map registration
for the {Name: "amazonriverwide"} entry in a conditional that only registers it
when the flag is true; update the map registration function (e.g. RegisterMaps
or wherever the slice containing {Name: "amazonriverwide"} is created) to check
the flag, and emit a clear log message when the map is skipped or enabled so
operators can see the state.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b17136b7-ff40-4f35-874a-138c5d92087b

📥 Commits

Reviewing files that changed from the base of the PR and between afdb04a and fd9c2f3.

⛔ Files ignored due to path filters (1)
  • map-generator/assets/maps/amazonriverwide/image.png is excluded by !**/*.png
📒 Files selected for processing (4)
  • map-generator/assets/maps/amazonriverwide/info.json
  • map-generator/main.go
  • resources/lang/en.json
  • src/core/game/Game.ts

},
{
"coordinates": [2458, 474],
"name": "Esperito Santo",
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.

⚠️ Potential issue | 🟡 Minor

Possible typo in nation name

"Esperito Santo" looks misspelled and may show incorrect text in UI.

✏️ Suggested fix
-      "name": "Esperito Santo",
+      "name": "Espírito Santo",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"name": "Esperito Santo",
"name": "Espírito Santo",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@map-generator/assets/maps/amazonriverwide/info.json` at line 46, The "name"
value "Esperito Santo" in the map info entry is likely misspelled; update the
value for the "name" key in the map's info.json (the entry currently reading
"Esperito Santo") to the correct nation name, e.g. "Espírito Santo" (or
"Espirito Santo" if your codebase avoids diacritics) so the UI displays the
proper name.

GameMapType.TwoLakes,
GameMapType.StraitOfHormuz,
GameMapType.AmazonRiver,
GameMapType.AmazonRiverWide,
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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Looking for frequency map and AmazonRiverWide key:"
rg -n -C3 'const frequency|AmazonRiverWide|frequency\[key\]\s*\?\?\s*0' src/server/MapPlaylist.ts

Repository: openfrontio/OpenFrontIO

Length of output: 680


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Checking complete frequency map ==="
# Extract the full frequency map object
rg -n -A 100 'const frequency: Partial' src/server/MapPlaylist.ts | head -80

echo ""
echo "=== Checking if AmazonRiverWide is in the frequency map ==="
rg -n 'AmazonRiverWide' src/server/MapPlaylist.ts || echo "AmazonRiverWide not found in MapPlaylist.ts"

echo ""
echo "=== Verifying AmazonRiverWide is in Game.ts categories ==="
rg -n -B2 -A2 'AmazonRiverWide' src/core/game/Game.ts

Repository: openfrontio/OpenFrontIO

Length of output: 2442


Add AmazonRiverWide to the frequency map in src/server/MapPlaylist.ts

GameMapType.AmazonRiverWide is added to the categories in Game.ts, but it is missing from the frequency map in MapPlaylist.ts. Without a frequency entry, the map gets weight 0 (via the frequency[key] ?? 0 fallback) and is excluded from playlist selection.

🧩 Suggested fix
--- a/src/server/MapPlaylist.ts
+++ b/src/server/MapPlaylist.ts
@@
   AmazonRiver: 3,
+  AmazonRiverWide: 3,
   BosphorusStraits: 3,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
GameMapType.AmazonRiverWide,
AmazonRiver: 3,
AmazonRiverWide: 3,
BosphorusStraits: 3,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/core/game/Game.ts` at line 185, GameMapType.AmazonRiverWide was added to
Game.ts but not included in the frequency map used by MapPlaylist, so its weight
falls back to 0 and it never gets selected; open MapPlaylist.ts and add an entry
for GameMapType.AmazonRiverWide to the frequency object (matching the style and
numeric weight pattern used for the other GameMapType keys) so it receives a
non-zero selection weight during playlist construction.

@github-project-automation github-project-automation bot moved this from Triage to Development in OpenFront Release Management Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development

Development

Successfully merging this pull request may close these issues.

1 participant