Skip to content

Fix: Improve trajectory visuals and SAM interception (+ perf) #5056

Closed

Description

@JB940

Describe the bug
During #5044 I've noticed various other issues with SAM circles not having the right off-set, visuals using true float values but core using integer etc. causing edge case behavior

To Reproduce
Steps to reproduce the behavior:

  1. Have a player build a SAM
  2. Aim your nuke at the edges of circles or past the edges, the behavior is inconsistent.

Expected behavior
For the visuals to match the gameplay.
This is fixed by:

  • the intercept logic using the actual gametile it shoots at (visuals still smooth)
  • by using a different algorithm to calculate interceptions. Instead of checking points - we trace the line between two points to calculate where it truly intercepts.
  • entirely rewrite the logic with many early guards, escapes and breaks. Optimize logic for parabola tracing with mathmatical equivalents that use less cpu intensive math.

See table:

Scenario Main New Code Gain
Scenario 1: 0 SAMs (Early game) 1,039,057 ops/sec 1,248,886 ops/sec +20.2%
Scenario 2: 5 SAMs (Active Intercept) 481,204 ops/sec 674,794 ops/sec +40.2%
Scenario 3: 20 SAMs (Mid-Late Game) 278,857 ops/sec 414,626 ops/sec +48.7%
Scenario 4: 100 SAMs (Giant World Map Endgame) 916,754 ops/sec 2,162,083 ops/sec +135.8%
In-Game Live Cursor Move (60 FPS per-frame update) 644,294 ops/sec 918,395 ops/sec +42.5%

This feature makes it so the visuals always show an X when a SAM intercepts it. False negatives are gone, and false positives (show X, not intercept) have been massively reduced. The perf will take a hit compared to main if this needs to be perfect, and it's only a single tile false positive on giant world map edge to edge on SAM range skirting

Screenshots

These gets intercepted:
Image
Image Image

This doesn't:

Image

The issues are wider, there are also arcs that get crossed out but don't get intercepted

Assignment

  • I'd like to be assigned to this issue and work on it myself
    • I have already got a PR waiting

Activity

  1. added
    not-approved
    on Aug 20, 2026
  2. github-actions commented on Aug 20, 2026

    @github-actions
    Contributor

    Hi @JB940, thanks for opening this issue. It hasn't been approved by a maintainer yet — we'll get back to you shortly to either milestone it (approval) or close it.

    — Automated. See CONTRIBUTING.md.

  3. added this to the Backlog milestone on Aug 22, 2026
  4. added
    approved
    and removed
    not-approved
    on Aug 22, 2026
  5. added a commit that references this issue on Aug 24, 2026
    574be84
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

approved

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions