Add Map - Amazon River Wide#3464
Conversation
add folder for amazon river wide
added sources files for amazon river wide
removed duplicate file
added amazon river wide
added amazon river wide
added amazon river wide
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
map-generator/main.go (1)
75-75: Consider a temporary-event gate for this map registrationSince 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
⛔ Files ignored due to path filters (1)
map-generator/assets/maps/amazonriverwide/image.pngis excluded by!**/*.png
📒 Files selected for processing (4)
map-generator/assets/maps/amazonriverwide/info.jsonmap-generator/main.goresources/lang/en.jsonsrc/core/game/Game.ts
| }, | ||
| { | ||
| "coordinates": [2458, 474], | ||
| "name": "Esperito Santo", |
There was a problem hiding this comment.
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.
| "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, |
There was a problem hiding this comment.
🧩 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.tsRepository: 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.tsRepository: 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.
| 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.
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