You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix: Improve trajectory visuals and SAM interception (+ perf) #5056
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:
Have a player build a SAM
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:
This doesn't:
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
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.
Activity
github-actions commentedon Aug 20, 2026
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.
Fix/nuke traj visuals perf (openfrontio#5083)