Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
110 changes: 110 additions & 0 deletions map-generator/assets/maps/amazonriverwide/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"name": "Amazon River Wide",
"nations": [
{
"coordinates": [524, 474],
"name": "Boa Esperança",
"flag": "br"
},
{
"coordinates": [30, 164],
"name": "Santa Rosa",
"flag": "br"
},
{
"coordinates": [1056, 8],
"name": "Paraíso",
"flag": "br"
},
{
"coordinates": [1161, 8],
"name": "Bom Futuro",
"flag": "br"
},
{
"coordinates": [1662, 474],
"name": "São Paulo de Olivença",
"flag": "br"
},
{
"coordinates": [1807, 8],
"name": "São João",
"flag": "br"
},
{
"coordinates": [1977, 7],
"name": "Castro Alves",
"flag": "br"
},
{
"coordinates": [2487, 70],
"name": "Flora",
"flag": "br"
},
{
"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.

"flag": "br"
},
{
"coordinates": [2590, 450],
"name": "Recreio",
"flag": "br"
},
{
"coordinates": [2937, 450],
"name": "Caturiá",
"flag": "br"
},
{
"coordinates": [3101, 470],
"name": "Correnteza",
"flag": "br"
},
{
"coordinates": [3354, 75],
"name": "Botafogo",
"flag": "br"
},
{
"coordinates": [3405, 460],
"name": "São João",
"flag": "br"
},
{
"coordinates": [3744, 470],
"name": "Cajual",
"flag": "br"
},
{
"coordinates": [3861, 470],
"name": "União",
"flag": "br"
},
{
"coordinates": [4409, 450],
"name": "Amaturá",
"flag": "br"
},
{
"coordinates": [4361, 55],
"name": "Monte Cristo",
"flag": "br"
},
{
"coordinates": [4649, 54],
"name": "Floresta",
"flag": "br"
},
{
"coordinates": [5050, 128],
"name": "Vargem Grande",
"flag": "br"
},
{
"coordinates": [5525, 370],
"name": "Baia",
"flag": "br"
}
]
}
1 change: 1 addition & 0 deletions map-generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ var maps = []struct {
{Name: "didier"},
{Name: "didierfrance"},
{Name: "amazonriver"},
{Name: "amazonriverwide"},
{Name: "yenisei"},
{Name: "tradersdream"},
{Name: "hawaii"},
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@
"didier": "Didier",
"didierfrance": "Didier (France)",
"amazonriver": "Amazon River",
"amazonriverwide": "Amazon River Wide",
"bosphorusstraits": "Bosphorus Straits",
"beringstrait": "Bering Strait",
"tradersdream": "Traders Dream",
Expand Down
2 changes: 2 additions & 0 deletions src/core/game/Game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export enum GameMapType {
Didier = "Didier",
DidierFrance = "Didier France",
AmazonRiver = "Amazon River",
AmazonRiverWide = "Amazon River Wide",
BosphorusStraits = "Bosphorus Straits",
BeringStrait = "Bering Strait",
Yenisei = "Yenisei",
Expand Down Expand Up @@ -185,6 +186,7 @@ export const mapCategories: Record<string, GameMapType[]> = {
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.

GameMapType.BosphorusStraits,
GameMapType.BeringStrait,
GameMapType.Yenisei,
Expand Down
Loading