Skip to content

[Minor] Optimize Interceptor #1733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Coronia
Copy link
Contributor

@Coronia Coronia commented Jun 20, 2025

split from #1568. This one is a bit controversial so I'd pull this alone for test and review

  • instead of selecting weapon for every bullet, used the fixed value from Interceptor.Weapon once and for all
  • added a RearmTimer check for the interceptor process

@github-actions github-actions bot added the Minor Documentation is not required label Jun 20, 2025
@Coronia Coronia added the ⚙️T1 T1 maintainer review is sufficient label Jun 20, 2025
Copy link

github-actions bot commented Jun 20, 2025

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

Copy link
Contributor

@Starkku Starkku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are misunderstanding how the interceptor code currently works. You have not taken into accord that all TechnoExt::ExtData::ApplyInterceptor() does is select an eligible BulletClass instance as the techno's target, it does not actually have the techno directly fire any weapons. It does not even execute most of the code if the techno currently has a target. As a result, removing weapon selector code makes it so that weapon actually fired against projectiles does not actually follow InterceptorWeapon.

Uncertain about the application of RearmTimer check as well. You are not technically checking for if the techno can fire here, you are supposed to be checking if it can target. If it already has a target, it bails out before this check anyway. A case could be made for separate targeting timer check here but the reality is that most projectiles are fast enough that not checking for it every frame can reduce accuracy dramatically. Normal target acquisition already suffers from similar issue with very fast moving units (such as AA vs. jets, potentially) due to NormalTargetingDelay/GuardAreaTargetingDelay being rather substantial.

Either rework how the logic works entirely or adjust/revert your fix to work with the current approach.

@Coronia
Copy link
Contributor Author

Coronia commented Jun 21, 2025

in this case I think the part that removing SelectWeapon from ApplyInterceptor could be kept, since it'll be forced to Interceptor.Weapon if the target is a bullet

other changes could be reverted for the sake of safety and accuracy

@Coronia Coronia added the Tested label Jun 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Minor Documentation is not required ⚙️T1 T1 maintainer review is sufficient Tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants