Skip to content

Clip view cones to Valorant map geometry#100

Merged
SunkenInTime merged 16 commits into
mainfrom
t3code/view-cone-clipping
Jul 18, 2026
Merged

Clip view cones to Valorant map geometry#100
SunkenInTime merged 16 commits into
mainfrom
t3code/view-cone-clipping

Conversation

@SunkenInTime

@SunkenInTime SunkenInTime commented Jul 10, 2026

Copy link
Copy Markdown
Owner

What changed

  • Added compact, generated VisionGeometry assets for every current map.
  • Clips free and agent-attached view cones with event-ray visibility polygons against the selected map/elevation layer.
  • Mirrors occluders with attack/defense side switching.
  • Persists a per-cone View elevation override with undo/redo and strategy migration support.
  • Uses Riot's exported elevation slices for 12 maps; Summit uses a deterministic boundary fallback generated from its current Icarus even-odd SVG because the available game export predates Summit.
  • Aligns the stale folder-icon migration marker with app version 92 so the repository's required full-suite CI check can pass.

Why

The previous painter rendered only a radial wedge, so cones bled through walls and outside map boundaries and could not choose the correct stacked-floor occluders.

Performance / impact

  • Geometry JSON is decoded off the UI isolate and cached per map.
  • Ray candidates are range-AABB filtered, with 2° arc samples plus endpoint/circle event rays to avoid corner leaks.
  • Generated assets total about 405 KiB.
  • Worst-case Summit fallback measured about 6.7 ms per cone computation in debug JIT on the development machine.

Verification

  • fvm flutter analyze — only the existing pages_bar.dart:514 deprecated-onReorder info.
  • fvm flutter test — all 262 tests pass.
  • New tests load all 13 map assets, verify defense mirroring, mirrored position/rotation symmetry, wall clipping, range arcs, corner event rays, and elevation serialization.
  • Generated all exported geometry assets from D:\Downloads\Output\Exports\ShooterGame.
  • Visually exercised the Windows editor with an isolated strategy; the Ascent 103° cone stops at the displayed corridor/wall boundaries.

@SunkenInTime
SunkenInTime marked this pull request as ready for review July 10, 2026 09:12
@greptile-apps

greptile-apps Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds map-aware clipping for Valorant view cones. The main changes are:

  • Generated compact vision geometry assets for each current map.
  • Ray-cast visibility polygons for free and agent-attached cones.
  • Defense-side geometry mirroring and per-cone elevation overrides.
  • Persistence, undo/redo, and migration support for view elevation.
  • Supporting tests for geometry loading, mirroring, clipping, and serialization.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
lib/widgets/draggable_widgets/utilities/view_cone_widget.dart Computes and paints clipped visibility polygons for view cones, including rotation, origin, elevation, and debug overlays.
lib/widgets/draggable_widgets/agents/placed_view_cone_agent_widget.dart Passes agent-attached cone rotation, origin, and elevation data into the clipping widget.
lib/view_cone/vision_geometry.dart Adds geometry loading, defense mirroring, elevation inference, boundary checks, and ray-cast polygon generation.
lib/const/coordinate_system.dart Adds conversion helpers between legacy widget offsets and normalized world coordinates.

Reviews (6): Last reviewed commit: "Infer view cone elevation from map heigh..." | Re-trigger Greptile

Comment thread lib/widgets/draggable_widgets/utilities/view_cone_widget.dart
Comment thread lib/widgets/draggable_widgets/utilities/view_cone_widget.dart Outdated

Copy link
Copy Markdown
Owner Author

@greptileai please re-review the latest head. The free-cone rotation now falls back to the persisted utility rotation, and the side-switch coordinate-frame invariant is documented and covered by a mirrored origin/rotation clipping regression test.

Copy link
Copy Markdown
Owner Author

@greptileai final re-review please: the latest head only aligns the pre-existing folder-icon migration marker with app version 92. The complete repository suite now passes (262/262).

@SunkenInTime

Copy link
Copy Markdown
Owner Author

Verified and fixed the Windows long-worktree build failure in 8ef6296. The WebView dependency target now uses a shorter Visual Studio project label, and a full debug build succeeds from the original nested path.\n\n@greptileai please review the latest head.

@SunkenInTime

Copy link
Copy Markdown
Owner Author

@greptileai

@SunkenInTime

Copy link
Copy Markdown
Owner Author

@greptileai

@SunkenInTime

Copy link
Copy Markdown
Owner Author

@greptileai please review the latest head. This update adds topmost navigation-height inference, automatic Riot elevation-slice selection, hybrid Riot blocker plus SVG boundary clipping, and a calibration overlay. The full local suite passes (269/269).

@SunkenInTime
SunkenInTime merged commit ee7117c into main Jul 18, 2026
1 check failed
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