Skip to content

Add Map Chopping Block#3952

Open
PatrickPlaysBadly wants to merge 1 commit into
openfrontio:mainfrom
PatrickPlaysBadly:ChoppingBlock
Open

Add Map Chopping Block#3952
PatrickPlaysBadly wants to merge 1 commit into
openfrontio:mainfrom
PatrickPlaysBadly:ChoppingBlock

Conversation

@PatrickPlaysBadly
Copy link
Copy Markdown
Contributor

Description:

Describe the PR.

Custom designed map based off of a wooden chopping block pattern/production method.
About 50 additional named nations have been added along with the 32 default.
Map is setup for 2 and 4 teams.

https://www.youtube.com/watch?v=SVwQWMtZRuI

https://discord.com/channels/1284581928254701718/1482787372654399489/1482787372654399489

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:

PlaysBadly

@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.


SAM seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 17, 2026

Review Change Stack

Walkthrough

This PR adds a new playable map called "Chopping Block" to the game. It includes map asset definitions, a new game map type, and integration points in the build system, translations, and map playlist rotation.

Changes

Chopping Block Map Addition

Layer / File(s) Summary
Map asset and metadata definitions
map-generator/assets/maps/choppingblock/info.json, resources/maps/choppingblock/manifest.json
Map layout, nation spawn coordinates, additional nation names, and team-based spawn rectangles for 2 and 4 player teams are defined in the map assets and manifest.
Map type registration
src/core/game/Game.ts
A new GameMapType.ChoppingBlock enum member is added and included in the mapCategories.arcade array.
Map build, language, and playlist integration
map-generator/main.go, resources/lang/en.json, src/server/MapPlaylist.ts
The map is registered in the map generator, given the display name "Chopping Block" in English translations, and assigned a frequency value of 5 in playlist rotation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • evanpelle

Poem

🗺️ A new arena carved from JSON dreams,
Chopping Block claims its rightful seam,
Through type and tier, from code to scene,
Where two and four shall battle keen! ⚔️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: adding a new map named Chopping Block. It is concise, clear, and directly describes the primary purpose of the pull request.
Description check ✅ Passed The description is directly related to the changeset, providing context about the map design, nation count, team configuration, and references to supporting materials. It demonstrates understanding of the changes being made.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/core/game/Game.ts`:
- Line 175: Add unit tests that cover the new enum member and its registration:
write a test asserting that the GameCategory (or relevant enum/class) includes
the "ChoppingBlock" member (e.g., check Game.ChoppingBlock or export where the
enum is defined) and another test asserting that the arcade category
registration (the function or map used to register categories, e.g.,
registerCategory or arcadeCategoryEntries) contains the ChoppingBlock entry;
ensure tests import the same symbols added in Game.ts and assert
membership/values so CI enforces the src/core/ change.
🪄 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: 2f20a946-4c81-4416-9370-6526bd2ff21c

📥 Commits

Reviewing files that changed from the base of the PR and between 2e17fb5 and 6674317.

⛔ Files ignored due to path filters (4)
  • map-generator/assets/maps/choppingblock/image.png is excluded by !**/*.png
  • resources/maps/choppingblock/map.bin is excluded by !**/*.bin
  • resources/maps/choppingblock/map16x.bin is excluded by !**/*.bin
  • resources/maps/choppingblock/map4x.bin is excluded by !**/*.bin
📒 Files selected for processing (7)
  • map-generator/assets/maps/choppingblock/info.json
  • map-generator/main.go
  • resources/lang/en.json
  • resources/maps/choppingblock/manifest.json
  • resources/maps/choppingblock/thumbnail.webp
  • src/core/game/Game.ts
  • src/server/MapPlaylist.ts

Comment thread src/core/game/Game.ts
MiddleEast = "Middle East",
TaiwanStrait = "Taiwan Strait",
DanishStraits = "Danish Straits",
ChoppingBlock = "Chopping Block",
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot May 17, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add tests for src/core/ changes.

The coding guidelines require that all changes to src/core/ include tests. The enum addition and category registration should have corresponding test coverage.

Consider adding a test to verify:

  • The ChoppingBlock enum member exists
  • ChoppingBlock is present in the arcade category

As per coding guidelines: "All changes to src/core/ must include tests"

Also applies to: 263-263

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/core/game/Game.ts` at line 175, Add unit tests that cover the new enum
member and its registration: write a test asserting that the GameCategory (or
relevant enum/class) includes the "ChoppingBlock" member (e.g., check
Game.ChoppingBlock or export where the enum is defined) and another test
asserting that the arcade category registration (the function or map used to
register categories, e.g., registerCategory or arcadeCategoryEntries) contains
the ChoppingBlock entry; ensure tests import the same symbols added in Game.ts
and assert membership/values so CI enforces the src/core/ change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Map has been tested. Video evidence provided. Thank you rabbit.

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.

@PatrickPlaysBadly, thanks for sharing the video evidence — that's great for confirming the map plays correctly! 🎉

My concern was specifically about automated unit tests for the TypeScript changes in src/core/game/Game.ts (the ChoppingBlock enum member and its arcade category entry), as the coding guidelines say all src/core/ changes must include tests.

That said, the change itself is very small — just adding one enum value and one list entry — so if the team considers this level of change exempt from that rule, that's totally fine. Would you like to open a follow-up issue to track adding automated test coverage for new GameMapType entries, or is this considered low enough risk to skip?

(🐇 hop hop — the map looks fun either way!)


🧠 Learnings used
Learnt from: FloPinguin
Repo: openfrontio/OpenFrontIO PR: 2874
File: src/server/MapLandTiles.ts:7-11
Timestamp: 2026-01-12T21:37:01.156Z
Learning: In this repository's OpenFrontIO deployment, inter-service HTTP calls to the master should target http://localhost:3000 (master at port 3000) as the canonical address. Apply this as the standard for all server-side TypeScript code that communicates with the master. Avoid hardcoding non-master URLs; centralize the master address (e.g., via config or env) when possible, and ensure internal service communication uses localhost:3000 in this architecture.

Learnt from: FloPinguin
Repo: openfrontio/OpenFrontIO PR: 2887
File: src/core/execution/NukeExecution.ts:118-122
Timestamp: 2026-01-13T20:16:05.535Z
Learning: In code paths that return a Player-like object, prefer returning a union type (Player | TerraNullius) instead of undefined. When a function may fail to find a player, return TerraNullius for the 'not found' case and a Player for valid IDs, and check .isPlayer() (or equivalent) directly on the result instead of guarding with undefined or optional chaining. This should be enforced in Game, GameImpl, and GameView (and similar accessors) to avoid undefined checks and simplify null-safety handling.

Learnt from: scamiv
Repo: openfrontio/OpenFrontIO PR: 3292
File: src/core/execution/TrainExecution.ts:70-84
Timestamp: 2026-02-25T02:38:42.961Z
Learning: Preserve the intentional duplication of boundary tiles when constructing train motion plan paths. Specifically, do not deduplicate tiles at station boundaries in train motion plan logic. This affects both server-side tracking (TrainExecution.ts saveTraversedTiles) and client-side processing (GameView.ts train motion plan processing). Reviewers should ensure changes do not remove or consolidate boundary tiles, as duplicates are expected and documented in MotionPlans.ts, and are necessary for correct car spacing and positioning, especially when speed > 1.

Learnt from: VariableVince
Repo: openfrontio/OpenFrontIO PR: 3549
File: tests/pathfinding/playground/server.ts:246-250
Timestamp: 2026-03-31T17:02:41.798Z
Learning: When migrating/implementing Express 5+ code, use the Express 5 `app.listen(PORT, (error) => { ... })` callback signature: Express 5 passes listen errors (e.g., `EADDRINUSE`) as the first argument to the callback. Handle the error inside that callback instead of relying on Node.js `http.Server`’s `'error'` event semantics.

Learnt from: baculinivan-web
Repo: openfrontio/OpenFrontIO PR: 3688
File: src/client/graphics/layers/GameRightSidebar.ts:235-248
Timestamp: 2026-04-22T08:54:50.345Z
Learning: In the OpenFrontIO/OpenFrontIO repository, do not raise review findings for standard web accessibility (a11y) keyboard/semantic issues that would normally require button semantics (e.g., using clickable `<div>` elements instead of `<button>`, or similar keyboard accessibility/ARIA patterns). This repository intentionally does not enforce those semantic/keyboard-accessibility conventions because gameplay requires touch or mouse input and is not operable via keyboard alone.

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.

@coderabbitai Dismiss. Individual maps do not require a change in the tests. No map is denoted in a test

@github-project-automation github-project-automation Bot moved this from Triage to Development in OpenFront Release Management May 17, 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.

3 participants