Skip to content

Clean up Line-of-Sight radial visualization - #148

Merged
candour merged 1 commit into
mainfrom
fix-los-visualization-14999766084127066769
May 11, 2026
Merged

Clean up Line-of-Sight radial visualization#148
candour merged 1 commit into
mainfrom
fix-los-visualization-14999766084127066769

Conversation

@candour

@candour candour commented May 11, 2026

Copy link
Copy Markdown
Owner

This change addresses the "crazy" radial lines seen in the stall selection UI. By filtering for only relevant obstacles (pillars within range) and correctly anchoring the shadow wedges at the obstacle's position rather than the stall's center, the visualization is now much cleaner and accurately reflects the actual blocked firing zones.


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

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Improved line-of-sight shadowing accuracy for obstruction pillars on the game board. Shadow obstruction visualization now activates only when pillar distance falls within the appropriate range and positions the shadow edge at the pillar's actual location, providing more precise visual feedback.

Review Change Stack

- Obstacles (Pillars) are now only considered if they are within the stall's attack range.
- Shadow wedges now correctly start from the pillar's position instead of the stall's center.
- Enforced that only pillars block LOS, as per user requirements.
- Improved distance checks to prevent self-blocking and ensure clean visual rendering.

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 May 11, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The stall selection line-of-sight shadow logic is refined to render obstruction wedges only when pillar distance falls between a lower threshold and the stall's range, with the wedge's near edge positioned at the pillar's actual distance instead of a fixed offset.

Changes

Line-of-Sight Shadow Wedge Refinement

Layer / File(s) Summary
Line-of-Sight Shadow Wedge Logic
app/src/main/java/com/messark/hawker/ui/components/GameBoard.kt
Shadow wedge rendering condition is narrowed to dist > 0.5f && dist < stall.range. Polygon start points are repositioned to use the pillar's actual distance instead of a fixed offset, while far points remain at stall.range.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • candour/towerpower#135: Both PRs modify GameBoard.kt's line-of-sight shadow rendering for pillar obstructions, with this PR refining the distance bounds and near-edge polygon positioning of the same shadow wedge logic.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: improving the line-of-sight radial visualization by fixing obstruction logic for shadowing pillars in the GameBoard stall selection UI.
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.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-los-visualization-14999766084127066769

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

🧹 Nitpick comments (1)
app/src/main/java/com/messark/hawker/ui/components/GameBoard.kt (1)

415-419: ⚡ Quick win

Make LOS blockers explicitly pillar-only

LOS shadows are still sourced from TileType.Obstruction via obstructions, so new obstruction subtypes could accidentally start blocking LOS. Since the requirement is pillar-only blocking, filter explicitly for TileType.PILLAR at source.

Proposed change
-            val obstructions = hexes.values.filter { it.type is TileType.Obstruction }
+            val obstructions = hexes.values.filter { it.type is TileType.PILLAR }

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 211bab2e-4ef5-4df2-bacc-e28836d6527e

📥 Commits

Reviewing files that changed from the base of the PR and between 4bde9b9 and b8078e2.

📒 Files selected for processing (1)
  • app/src/main/java/com/messark/hawker/ui/components/GameBoard.kt

@github-actions

Copy link
Copy Markdown

Build Successful! 🚀

Download APK

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

@candour
candour merged commit be3e1e8 into main May 11, 2026
3 checks passed
@candour
candour deleted the fix-los-visualization-14999766084127066769 branch May 11, 2026 16:05
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