bugfix(ai): Fix supply attack detection timing and unrecorded damage/healing timestamp handling - #3380
bugfix(ai): Fix supply attack detection timing and unrecorded damage/healing timestamp handling#3380WebbontheWeb wants to merge 11 commits into
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughBoth game variants set the supply-attack scan interval to 10 frames in ChangesSupply attack scan interval
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to Non-CRC builds now retain supply attacks for 10 seconds, while CRC-compatible builds preserve their prior behavior. No actionable merge-blocking risk remains; the change is ready for normal checks. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 2 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation Issue 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. Comment |
|
7d340d2 to
63f40b9
Compare
Skyaero42
left a comment
There was a problem hiding this comment.
This change is fine pending a few nits.
63f40b9 to
9558198
Compare
xezon
left a comment
There was a problem hiding this comment.
Comments can be restyled, otherwise makes sense.
9558198 to
3e53105
Compare
3e53105 to
c288acb
Compare
c288acb to
e1e9c0e
Compare
|
Greptile still has an open review with a concern that looks valid. |
|
Considering the original code had a comment indicating that 10 seconds was intended for SCAN_RATE, I don't believe that's an issue. If we think it is, I could update to separate the "refresh rate" from SCAN_RATE. m_supplySourceAttackCheckFrame could be incremented using the previous 10 frame value, while the rest could use the corrected SCAN_RATE. |
|
I sent an inquiry to kabuse about this. |
|
-TanSo-
|
|
Thanks for the feedback, it's been updated. I split SCAN_RATE into REFRESH_RATE (how often isSupplySourceAttacked can be checked) and SCAN_WINDOW (how far back it's checking). I wasn't sure how to keep the EA comment, since it doesn't accurately describe either of the variables, so I moved it above with a disclaimer. I also updated my map script to verify that the refresh is tracked separately from the scan. Before the tank attacks it now checks whether the supply truck has been attacked. It checks again 4 seconds after the attack. The previous version doesn't register that it has been attacked (defeat): previoussupplyfix.mp4While the updated version does (victory): newsupplyfix.mp4Map: |
6ec4e6a to
9f1a75a
Compare
…amage is recorded
…p for retail compatibility
…healing is recorded
xezon
left a comment
There was a problem hiding this comment.
What started as a small fix, became a broader fix. The change title and description needs updating.
Updates
AIPlayer::isSupplySourceAttacked()to check within the last 10 seconds, instead of the last 10 frames.It splits
SCAN_RATEintoRefreshRateandScanWindow, theRefreshRatestays at 10 frames, whileScanWindowis10 * LOGICFRAMES_PER_SECONDAlso includes updates to the damage and healing timestamp getters. Now
getLastHealingTimestampandgetLastDamageTimestampreturnnullptrwhen there's been no damage or no healing to prevent initial placeholder timestamps from being treated as recent healing or damage.All this changes AI behavior and may break retail compatibility. It's removed with RETAIL_COMPATIBLE_CRC enabled.
Verified using a custom map where
After 4 seconds, a script checks whether the supply source is under attack. If true, victory. If false, defeat.
Running the supply source check twice ensures that RefreshRate is being handed separately than ScanWindow.
Before updates:
withoutsupplyfix.mp4
After updates:
newsupplyfix.mp4
Map:
SupplyAttack2386.zip
Included replays ran successfully.