Skip to content

Conversation

@FloPinguin
Copy link
Contributor

@FloPinguin FloPinguin commented Jan 6, 2026

Description:

We didn't have a river map and we didn't have a map with a crazy size.
So I made a "Amazon River" map with a crazy size.
280 x 5536!
21 nations based on real locations.
Should be interesting gameplay because you don't have many attack options, your only escape is the river.
The land tiles size is similar to the achiran and iceland map.

Screenshot 2026-01-06 150831 Screenshot 2026-01-06 150957

Because the map is so wide, it looked really ugly stretched in the thumbnails. So I added some CSS which removes the thumbnail stretching of the Amazon River map. We can also use this logic for other thumbnails which shouldn't get stretched.

In Maps.ts, PublicLobby.ts and GameInfoModal.ts.

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:

FloPinguin

@FloPinguin FloPinguin requested a review from a team as a code owner January 6, 2026 14:33
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 6, 2026

Walkthrough

Adds the "Amazon River" map: assets and manifest, registers it in the generator and playlist, extends GameMapType and default player counts, adds localization, and applies conditional thumbnail styling in client components.

Changes

Cohort / File(s) Summary
Map Assets & Manifest
map-generator/assets/maps/amazonriver/info.json, resources/maps/amazonriver/manifest.json
New map data and manifest: map metadata, scaled variants, and 23 Brazilian nation entries with coordinates.
Map Registry
map-generator/main.go
Registered amazonriver in the map-generator list.
Server Playlist
src/server/MapPlaylist.ts
Added AmazonRiver to playlist frequencies (weight = 3).
Core Game Types & Helper
src/core/game/Game.ts
Added GameMapType.AmazonRiver, included it in mapCategories, and added export function hasUnusualThumbnailSize(map: GameMapType): boolean.
Default Config
src/core/configuration/DefaultConfig.ts
Added GameMapType.AmazonRiver entry to numPlayersConfig with values [50, 40, 30].
Client - Map UI
src/client/components/Maps.ts, src/client/GameInfoModal.ts, src/client/PublicLobby.ts
Added Amazon River description/local key; imported and used hasUnusualThumbnailSize to conditionally apply object-fit: cover; object-position: center; (or CSS class) for thumbnails.
Localization
resources/lang/en.json
Added "amazonriver": "Amazon River" under map localization.

Sequence Diagram(s)

(No sequence diagrams generated — changes are data/config additions with a small UI styling special-case, not a multi-component control-flow change requiring visualization.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

Feature - Map, Maps

Suggested reviewers

  • evanpelle
  • Tidwell
  • Duwibi

Poem

🌿 A ribbon of tiles in river light,
Flags of Brazil tucked in tight,
Thumbnails centered, pixels sing,
Fifty players may join the ring,
Merge it in — the Amazon takes flight.

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically announces the new Amazon River map addition, which is the primary focus of the changeset across all modified files.
Description check ✅ Passed The description is directly related to the changeset, detailing the new Amazon River map's dimensions, game design rationale, CSS thumbnail fix, and implementation across multiple files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

📜 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 413556a and c462b3e.

📒 Files selected for processing (4)
  • src/client/GameInfoModal.ts
  • src/client/PublicLobby.ts
  • src/client/components/Maps.ts
  • src/core/game/Game.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/core/game/Game.ts
  • src/client/components/Maps.ts
  • src/client/PublicLobby.ts
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: VariableVince
Repo: openfrontio/OpenFrontIO PR: 1655
File: resources/maps/giantworldmap/manifest.json:165-174
Timestamp: 2025-07-31T12:03:08.052Z
Learning: In OpenFrontIO draft PRs, flag names in map manifest files may be placeholders that will be updated to match the actual SVG flag file names when the assets are received. The final naming depends on the actual flag SVG files provided, not code naming conventions.
📚 Learning: 2025-06-09T02:20:43.637Z
Learnt from: VariableVince
Repo: openfrontio/OpenFrontIO PR: 1110
File: src/client/Main.ts:293-295
Timestamp: 2025-06-09T02:20:43.637Z
Learning: In src/client/Main.ts, during game start in the handleJoinLobby callback, UI elements are hidden using direct DOM manipulation with classList.add("hidden") for consistency. This includes modals, buttons, and error divs. The codebase follows this pattern rather than using component APIs for hiding elements during game transitions.

Applied to files:

  • src/client/GameInfoModal.ts
🧬 Code graph analysis (1)
src/client/GameInfoModal.ts (1)
src/core/game/Game.ts (1)
  • hasUnusualThumbnailSize (120-122)
🔇 Additional comments (2)
src/client/GameInfoModal.ts (2)

4-4: LGTM! Clean import of shared utility.

Importing hasUnusualThumbnailSize centralizes the logic for determining which maps need special thumbnail styling. This avoids duplicating the map-type check across multiple files.


108-118: LGTM! Clean conditional styling implementation.

The approach is straightforward:

  1. Call hasUnusualThumbnailSize to check if the map needs special styling
  2. Apply Tailwind classes conditionally using template literal interpolation

Using Tailwind classes (object-cover object-center) is cleaner and more maintainable than inline styles.


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.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 6, 2026
Duwibi
Duwibi previously approved these changes Jan 6, 2026
Copy link
Contributor

@Duwibi Duwibi left a comment

Choose a reason for hiding this comment

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

I love the size of this map 🤣. It's way more unique compared to the other maps in the game. I'd suggest that you limit the nations a bit, but it's completely your call. After all, you made all of the changes to the nations and know better than me how they're going to impact gameplay.
I haven't tested it, but it's free to go if it runs smoothly 👍

@FloPinguin
Copy link
Contributor Author

I love the size of this map 🤣. It's way more unique compared to the other maps in the game. I'd suggest that you limit the nations a bit, but it's completely your call. After all, you made all of the changes to the nations and know better than me how they're going to impact gameplay. I haven't tested it, but it's free to go if it runs smoothly 👍

Thank you :)
About the nations, I think its good to have maps with a small amount of nations (looking at fourislands, achiran, faroeislands, twolakes, svalmel, ...) and maps with many nations (europe, northamerica, world, ...) for more variety. In public games they should be an easy target anyway, especially in v29 because of my nerfs

@VariableVince
Copy link
Contributor

VariableVince commented Jan 6, 2026

The fact that you don't get to see the whole map in a thumbnail anymore this way (even if stretched) bothers me a bit. For example the four islands thumbnail was clearer before. Baikal is impacted negatively too imo and there are more like this.

I'd prefer the new CSS to only affect edge case maps like this new Amazon River map (which seems great btw), so only for a predefined 'offness' we do this new trick but leave the rest alone

Tryout33

@FloPinguin FloPinguin dismissed stale reviews from Duwibi and coderabbitai[bot] via c733171 January 6, 2026 15:53
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 6, 2026
@FloPinguin
Copy link
Contributor Author

The fact that you don't get to see the whole map in a thumbnail anymore this way (even if stretched) bothers me a bit. For example the four islands thumbnail was clearer before. Baikal is impacted negatively too imo and there are more like this.

I'd prefer the new CSS to only affect edge case maps like this new Amazon River map (which seems great btw), so only for a predefined 'offness' we do this new trick but leave the rest alone

Tryout33

I was hesitating with adding logic just for this map.
But you convinced me, the CSS changes are now only for this new map.
Updated PR description.

@evanpelle
Copy link
Collaborator

mind fixing the conflicts, i think it was from updating tailwind to v4

# Conflicts:
#	src/client/GameInfoModal.ts
#	src/client/PublicLobby.ts
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: 2

🤖 Fix all issues with AI Agents
In @src/client/GameInfoModal.ts:
- Around line 108-112: Duplicate logic for AmazonRiver thumbnail styling exists
in GameInfoModal.ts, PublicLobby.ts, and Maps.ts; extract it to a shared utility
by adding a constant (e.g., MAP_THUMBNAIL_COVER_STYLE = "object-fit: cover;
object-position: center;") and a helper function (e.g.,
getMapThumbnailStyle(mapType: GameMapType | string)) that returns the constant
when mapType === GameMapType.AmazonRiver (or "AmazonRiver") and an empty string
otherwise, then replace the inline checks in GameInfoModal
(isUnusualThumbnailSize / objectFitStyle), PublicLobby, and Maps to call
getMapThumbnailStyle instead.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c9e1315 and dfeffca.

📒 Files selected for processing (3)
  • src/client/GameInfoModal.ts
  • src/client/PublicLobby.ts
  • src/client/components/Maps.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/client/PublicLobby.ts
🔇 Additional comments (1)
src/client/components/Maps.ts (1)

51-51: LGTM!

The addition of the AmazonRiver entry to MapDescription is correct and consistent with the existing pattern.

@FloPinguin
Copy link
Contributor Author

mind fixing the conflicts, i think it was from updating tailwind to v4

Fixed
Also put shared logic isUnusualThumbnailSize into Game.ts (Coderabbit idea)

Copy link
Collaborator

@evanpelle evanpelle left a comment

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 to the v29 milestone Jan 7, 2026
@evanpelle evanpelle merged commit 387190b into openfrontio:main Jan 7, 2026
8 of 9 checks passed
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.

4 participants