Skip to content

Let nukes fly over impassable terrain - #4850

Merged
evanpelle merged 1 commit into
mainfrom
feat/nukes-fly-over-impassable
Aug 3, 2026
Merged

Let nukes fly over impassable terrain#4850
evanpelle merged 1 commit into
mainfrom
feat/nukes-fly-over-impassable

Conversation

@evanpelle

Copy link
Copy Markdown
Collaborator

Description:

Nukes (and MIRVs) now fly over impassable terrain instead of being blocked by it. This removes the trajectory restriction introduced with impassable terrain in #4340 and supersedes the silo path-selection workaround from #4815.

Core (sim):

  • NukeExecution no longer aborts the launch or flips the curve direction when the parabola crosses impassable terrain
  • PlayerImpl.nukeSpawn picks the plain closest ready silo again; the MIRV special case collapsed away since nothing is blocked anymore
  • Nation AI (NationNukeBehavior) no longer skips silos/targets whose trajectory crosses impassable terrain
  • Deleted the now-unused isParabolaBlocked / clearParabolaDirection helpers from PathFinder.Parabola.ts

Unchanged — impassable terrain itself still can't be nuked:

  • Targeting an impassable tile is still rejected in nukeSpawn
  • The blast radius still skips impassable tiles (no destruction / flooding)

Client preview:

  • Hovering impassable terrain with a nuke selected keeps the ghost icon and blast circle hidden (the "void" treatment from Add impassable terrain 🗺️ #4340), but now shows the trajectory arc with the red X marker pinned at the untargetable destination. This reuses the existing SAM-intercept marker machinery by clamping tSamIntercept to 0.9999 — the X tracks the live cursor per frame
  • Removed the impassable-blocked (red arc + mid-flight X) preview logic and the silo/curve mirroring of the old sim behavior

Tests: trajectory tests rewritten to assert fly-over-and-detonate; curve-flip and blocked-silo-selection tests from #4815 removed; NukeTrajectory.test.ts trimmed to the generic threshold math.

🤖 Generated with Claude Code

Removes the rule (from #4340) that nuke trajectories cannot cross
impassable terrain, and with it the silo path-selection / curve-flip
workaround from #4815, which this supersedes:

- NukeExecution no longer aborts or flips the curve at launch
- nukeSpawn picks the plain closest ready silo again (MIRV special
  case collapsed away)
- Nation AI no longer skips silos/targets behind impassable walls
- isParabolaBlocked / clearParabolaDirection helpers deleted

Impassable terrain itself still can't be nuked: targeting is rejected
in nukeSpawn and the blast radius still skips impassable tiles.

Client preview: hovering impassable terrain with a nuke keeps the
ghost hidden (void treatment) but now shows the trajectory arc with
the red X marker pinned at the untargetable destination, reusing the
SAM-intercept marker machinery (tSamIntercept clamped to 0.9999).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c3b0bd9b-e505-4670-a09d-318e72803d25

📥 Commits

Reviewing files that changed from the base of the PR and between af154a0 and 9f01b9d.

📒 Files selected for processing (8)
  • src/client/controllers/BuildPreviewController.ts
  • src/client/render/gl/utils/NukeTrajectory.ts
  • src/core/execution/NukeExecution.ts
  • src/core/execution/nation/NationNukeBehavior.ts
  • src/core/game/PlayerImpl.ts
  • src/core/pathfinding/PathFinder.Parabola.ts
  • tests/ImpassableTerrain.test.ts
  • tests/NukeTrajectory.test.ts
💤 Files with no reviewable changes (1)
  • src/core/pathfinding/PathFinder.Parabola.ts

Walkthrough

Nuke trajectories no longer treat impassable terrain as a launch or path blocker. Preview rendering still marks blocked destinations, while ghost validation remains separate. Silo selection, AI planning, execution, and tests now support terrain-crossing nukes.

Changes

Nuke terrain crossing behavior

Layer / File(s) Summary
Trajectory thresholds
src/client/render/gl/utils/NukeTrajectory.ts, tests/NukeTrajectory.test.ts
Removed terrain interception from threshold computation. SAM and untargetable-zone handling remain covered by tests.
Build preview flow
src/client/controllers/BuildPreviewController.ts
Trajectories render over impassable destinations. Invalid build ghosts remain suppressed, and blocked destinations receive an X marker.
Launch and silo selection
src/core/execution/NukeExecution.ts, src/core/execution/nation/NationNukeBehavior.ts, src/core/game/PlayerImpl.ts, src/core/pathfinding/PathFinder.Parabola.ts
Removed terrain-clearance checks and parabola-direction switching. Silo selection now uses the nearest eligible silo.
Behavior tests
tests/ImpassableTerrain.test.ts
Updated terrain fixtures and tests for active terrain-crossing nukes and terrain-independent silo selection.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested labels: Bugfix

Suggested reviewers: aotumuri

Poem

Across the wall, the nuke flies,
SAMs still watch the open skies.
The nearest silo takes its stand,
While ghosts stay off forbidden land.
A marked X guards the ground below.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: nukes can cross impassable terrain.
Description check ✅ Passed The description accurately covers simulation, AI, client preview, targeting, blast effects, and test changes related to the pull request.
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 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

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.

@evanpelle evanpelle added this to the v33 milestone Aug 3, 2026
@evanpelle
evanpelle merged commit 60f3745 into main Aug 3, 2026
15 of 16 checks passed
@evanpelle
evanpelle deleted the feat/nukes-fly-over-impassable branch August 3, 2026 16:13
@github-project-automation github-project-automation Bot moved this from Triage to Complete in OpenFront Release Management Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

1 participant