bugfix(neutronmissile): Fix and improve Nuke Missile damage for large objects inside the outer blast radius - #3161
Conversation
PR Summary by QodoFix Nuke Missile outer-radius targeting and improve large-object damage sampling
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1. Nuke falloff fix disabled
|
… objects inside the outer blast radius Large structures are now properly damaged if they reach into the outer blast radius and more damage is applied by taking the closest edge into the damage calculation
80b8d0d to
9928746
Compare
|
Rebased. |
| const Coord3D missileToObjectCenter = *otherPos - *missilePos; | ||
|
|
||
| Coord3D missileToObjectEdge; | ||
| ThePartitionManager->getVectorTo(other, missilePos, FROM_BOUNDINGSPHERE_2D, missileToObjectEdge); |
There was a problem hiding this comment.
Shouldn't this also use bounding sphere 3D as well?
Large structures are now properly damaged if they reach into the outer blast radius and more damage is applied by taking the closest edge into the damage calculation.
Original behavior 1
The China Nuke Missile applies no damage to the edges of buildings (and units). This is mostly noticeable with large structures, such as the Airfield. The blast radius needs to reach the center of every building (and unit).
Note that the Nuke Missile has an outer and inner damage radius. The outer radius applies less damage than the inner radius. The damage transition from inner to outer radius is linear.
Firing the Nuke Missile as follows applies NO damage to the structure:
Fixed behavior 1
The China Nuke Missile now applies damage to the edges of a building like all other weapons do.
This is a BUFF, but a very small one, because the building will receive the SMALLEST damage of the outer blast radius.
This is how much damage is applied to the Airfield after fixing the bug:
Rationale
The China Nuke blast radius is already not competitive compared to the SCUD Storm. The Nuke Missile needs buffing anyway and this bug fix is a good step into this direction.
Original behavior 2
Structures that are located between the inner and outer radii of the Nuke Missile do receive an interpolated damage between the max (inner) and min (outer) damages. This works well enough for small structures like a Gattling Cannon or Tunnel Network, but does not work well for large structures, such as the Airfield or SCUD Storm, because the damage sample point will be the center of the structure instead of a point closer to the actual damage radius of the Nuke Missile.
In practice this means that large structures at the egdes of the Nuke Missile will receive rather tiny damages, even if they reach reasonably far into the outer damage radius.
To fix this, the damage sample point needs to be moved closer to the Nuke Missile origins.
Showcase
The Nuke Missile applies little damage to large structures at the outer edge
generalszh.2026-08-16.11-29-18-88.mp4
Improved behavior 2
The logic now samples the damage point from the center to half of the outer edge of the object closest to the Nuke Missile origin. This works well for small and large objects.
BUFF for China. Does NOT make the Nuke Missile any better against small buildings and units, nor against targets inside the inner damage radius. The Nuke Missile will still perform worse than the SCUD Storm.
Showcase
The Nuke Missile applies considerably more damage to large structures at the outer edge
generalszh.2026-08-16.11-13-29-30.mp4
The SCUD Storm still applies more damage to large structures at the outer edge, because it applies around 20% more damage overall.
generalszh.2026-08-16.11-14-02-24.mp4
TODO