test(neutronmissile): Add debug draw for nuke missile radius - #3160
Conversation
Can be toggled with particle path debug CTRL+SHIFT+B
Code Review by Qodo
1. Outer radius ring omitted
|
| if (blastInfo->minDamage > 0.0f) | ||
| { | ||
| drawDebugRadiusRing( missilePos, blastInfo->outerRadius, tileWidth, duration, outerColor ); | ||
| } |
There was a problem hiding this comment.
1. Outer radius ring omitted 🐞 Bug ≡ Correctness
displayBlastRadii() draws the outer-radius ring only when minDamage > 0, even though doBlast() still uses outerRadius to scan/compute falloff damage when minDamage == 0. This can hide the real affected area in the new debug visualization and mislead tuning/debugging.
Agent Prompt
## Issue description
The debug visualization draws the outer ring only when `blastInfo->minDamage > 0.0f`. But `doBlast()` still iterates/scans objects in `outerRadius` and computes falloff using `outerRadius` even when `minDamage == 0.0f`.
## Issue Context
This makes the debug ring omit the meaningful outer boundary for weapons where damage falls off to 0 at the edge.
## Fix Focus Areas
- Update the condition in `displayBlastRadii()` to use `blastInfo->outerRadius` (and optionally `blastInfo->maxDamage || blastInfo->minDamage`) rather than requiring `minDamage > 0`.
- file: GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp[318-336]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| pos.z = TheTerrainLogic->getGroundHeight( pos.x, pos.y ); | ||
|
|
||
| addIcon( &pos, tileWidth, numFramesDuration, color ); | ||
| } |
There was a problem hiding this comment.
2. Unclamped icon tile width 🐞 Bug ☼ Reliability
drawDebugRadiusRing() clamps tileWidth only for segment count, but passes the raw tileWidth into addIcon(); if DebugProjectileTileWidth is configured as 0 or negative, icons become degenerate/unintended and the ring can disappear or render incorrectly. This makes the new debug feature fragile to configuration values.
Agent Prompt
## Issue description
`drawDebugRadiusRing()` uses `max(tileWidth, 1.0f)` to avoid divide-by-zero in segment calculation, but still calls `addIcon(..., tileWidth, ...)` with the original value.
## Issue Context
`DebugProjectileTileWidth` is parsed as a raw `Real` with no validation, and the renderer uses `width/2` directly when building quads.
## Fix Focus Areas
- Sanitize width once (e.g., `Real iconWidth = max(tileWidth, 1.0f);`) and use `iconWidth` for both segment calculation and the `addIcon()` call.
- file: GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/NeutronMissileSlowDeathUpdate.cpp[293-316]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
PR Summary by QodoAdd RTS_DEBUG blast-radius debug draw for Neutron Missile
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
This change adds a debug draw for the nuke missile radius in RTS_DEBUG.
Can be toggled with particle path debug CTRL+SHIFT+B
Base code was generated by Claude Opus and tweaked by hand.