Skip to content

Irregular Board Generation and Linear Pillar Clustering#198

Merged
candour merged 2 commits into
mainfrom
feature/irregular-board-generation-6605583459429279648
Jul 1, 2026
Merged

Irregular Board Generation and Linear Pillar Clustering#198
candour merged 2 commits into
mainfrom
feature/irregular-board-generation-6605583459429279648

Conversation

@candour

@candour candour commented Jul 1, 2026

Copy link
Copy Markdown
Owner

This change makes the game board more organic and less rigid. It introduces "holes" along the edges by removing a number of tiles equal to half the board's height, while ensuring every row maintains a minimum width of 4 and that the entrance and exit are always reachable. Additionally, pillar generation has been updated to create small, linear clusters (lines) rather than large masses (blobs), with a target of 3-4 clusters per board.


PR created automatically by Jules for task 6605583459429279648 started by @candour

Summary by CodeRabbit

  • Bug Fixes
    • Improved random map generation so start and goal positions always land on valid tiles after holes are carved.
    • Updated path generation to use the final valid start/end positions, reducing the chance of broken or unreachable maps.
    • Adjusted pillar placement to create more consistent clustered terrain patterns.

- Modified `MapGenerator.kt` to remove `height / 2` random edge tiles, creating an irregular board shape.
- Enforced a minimum width of 4 tiles per row during hole removal.
- Protected start and end rows from hole removal to ensure entrance/exit stability.
- Refactored `generateClumpedPillars` to grow in lines instead of blobs.
- Adjusted cluster count to target 3-4 clusters on average.
- Verified changes with new unit tests for board properties and connectivity.

Co-authored-by: candour <4670475+candour@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@candour, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 56b4d817-f5c5-4953-85e6-e5fd092bd5aa

📥 Commits

Reviewing files that changed from the base of the PR and between 7fc385c and 2a28ac9.

📒 Files selected for processing (1)
  • app/src/main/java/com/messark/hawker/utils/MapGenerator.kt
📝 Walkthrough

Walkthrough

Modifies MapGenerator.kt's vertical map generation to carve randomized edge holes and recompute start/end positions accordingly, and changes pillar clustering to clamp core count between 2-5 and use linear directional growth instead of probabilistic blob expansion.

Changes

Map Generation Logic

Layer / File(s) Summary
Edge holes and recalculated start/end positions
app/src/main/java/com/messark/hawker/utils/MapGenerator.kt
generateRandomVerticalMap builds full coordinate set with row-width tracking, removes randomized edge holes from non-start/end rows, recomputes finalStartPos/finalEndPos against remaining coordinates, uses them for path generation and tile typing, and returns them in the resulting Triple.
Pillar core count and linear growth
app/src/main/java/com/messark/hawker/utils/MapGenerator.kt
generateClumpedPillars clamps core count to a 2-5 range and replaces multi-neighbor blob growth with single-direction linear extension of limited random length.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

  • candour/towerpower#131: Both PRs change MapGenerator.generateRandomVerticalMap's start/end coordinate selection and validation after map carving.
  • candour/towerpower#197: Both PRs modify generateRandomVerticalMap and generateClumpedPillars behavior in the same file.

Poem

A hare hopped through the hex-tile maze,
Carving holes in winding ways,
Start and end recomputed true,
Pillars now grow straight, not askew,
Two to five cores, a tidy phase. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly captures the two main changes: irregular board generation and linear pillar clustering.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/irregular-board-generation-6605583459429279648

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.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Build Successful! 🚀

Download APK

Note: This link will be removed when the PR is closed.

@coderabbitai coderabbitai Bot left a comment

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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/src/main/java/com/messark/hawker/utils/MapGenerator.kt (1)

45-98: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Stale startPos/endPos reference after introducing finalStartPos/finalEndPos.

finalStartPos/finalEndPos are correctly computed and used for path generation (line 90) and tile typing (lines 103-104), but the obstruction-candidate filter at Lines 93-95 still excludes based on the original startPos/endPos, not the recomputed final positions:

val obstructionCandidates = allCoords.filter {
    it != startPos && it != endPos && it !in path
}.toMutableSet()

This is currently masked because hole removal is restricted to rows 1 until height - 1, so startR/endR are always protected and finalStartPos == startPos / finalEndPos == endPos in practice — making the recompute fallback at lines 78-87 effectively dead code too. If hole-carving logic is ever extended to touch start/end rows, this stale reference would silently let pillar cores land on the entrance/exit tile's coordinate (wasting cluster budget), relying only on the when ordering at lines 103-104 to mask the mistake.

🔧 Proposed fix
         val obstructionCandidates = allCoords.filter {
-            it != startPos && it != endPos && it !in path
+            it != finalStartPos && it != finalEndPos && it !in path
         }.toMutableSet()

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3be50450-1c60-4eb3-858d-e09f9912d73e

📥 Commits

Reviewing files that changed from the base of the PR and between a00aecd and 7fc385c.

📒 Files selected for processing (1)
  • app/src/main/java/com/messark/hawker/utils/MapGenerator.kt

@candour
candour merged commit 9b143ef into main Jul 1, 2026
3 checks passed
@candour
candour deleted the feature/irregular-board-generation-6605583459429279648 branch July 1, 2026 04:51
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Build Successful! 🚀

Download APK

Note: This link will be removed when the PR is closed.

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.

1 participant