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

Allow countermeasures to pulse at regular intervals instead of globally. #647

Merged
merged 1 commit into from Aug 24, 2017

Conversation

Projects
None yet
3 participants
@MageKing17
Member

MageKing17 commented Jul 9, 2016

Adds a new "+Pulse Interval:" countermeasure field that enables the new behavior; all countermeasures that don't have this field defined still use the old behavior of the global frame counter.

This changes countermeasure logic quite a bit, but I attempted to mitigate performance implications by re-using an existing traversal of the object list in order to build the list of active countermeasures each frame. If any countermeasures are actively pulsing in a frame, the object list is traversed again, looking for homing weapons. Each homing weapon then goes through the active countermeasure list and checks to see if it got decoyed. Most of this central logic is unchanged from the old behavior, although no longer separated into two functions, and it should be more efficient since it's using a prepared list of active countermeasures instead of traversing the object list looking for countermeasures for every homing missile (which are themselves found by traversing the object list).

This is the much-anticipated, long-awaited replacement for PR #441. I did my best to keep the impact as minimal as possible, but it could really use some stress testing in missile-and-countermeasure-rich environments.

@MageKing17

This comment has been minimized.

Show comment
Hide comment
@MageKing17

MageKing17 Jul 14, 2016

Member

I rebased onto latest master and put out a test build to hopefully gather some real data on how well it performs.

Member

MageKing17 commented Jul 14, 2016

I rebased onto latest master and put out a test build to hopefully gather some real data on how well it performs.

@MageKing17

This comment has been minimized.

Show comment
Hide comment
@MageKing17

MageKing17 Aug 9, 2016

Member

Rebased again (branch was pre-SDL2) and made a new set of test builds.

Member

MageKing17 commented Aug 9, 2016

Rebased again (branch was pre-SDL2) and made a new set of test builds.

@asarium

This comment has been minimized.

Show comment
Hide comment
@asarium

asarium Sep 28, 2016

Member

Are these changes stable now? I saw that you posted new build on the forums but I don't know if there are still known issues with these changes.

Member

asarium commented Sep 28, 2016

Are these changes stable now? I saw that you posted new build on the forums but I don't know if there are still known issues with these changes.

@MageKing17

This comment has been minimized.

Show comment
Hide comment
@MageKing17

MageKing17 Sep 28, 2016

Member

I haven't gotten any feedback one way or another about these changes (it's probably about time for another rebase and set of builds anyway; I'll try to get around to that some time in the next week).

Member

MageKing17 commented Sep 28, 2016

I haven't gotten any feedback one way or another about these changes (it's probably about time for another rebase and set of builds anyway; I'll try to get around to that some time in the next week).

@MageKing17

This comment has been minimized.

Show comment
Hide comment
@MageKing17

MageKing17 Dec 31, 2016

Member

Finally got around to rebasing this ("some time in the next week"; hah!). Compiling a fresh set of test builds now; I'll bump the linked thread when I get around to uploading them.

EDIT: And done.

Member

MageKing17 commented Dec 31, 2016

Finally got around to rebasing this ("some time in the next week"; hah!). Compiling a fresh set of test builds now; I'll bump the linked thread when I get around to uploading them.

EDIT: And done.

@asarium

There is nothing that seems like it could cause issues. One minor issue but everything else looks good. However, I don't know if the timed countermeasures will actually work.

Show outdated Hide outdated code/weapon/weapons.cpp
@asarium

The only issue from my last review was fixed so this now looks good to me.

@asarium asarium added this to the Release 3.8.2 milestone Jun 7, 2017

@TRBlount

This comment has been minimized.

Show comment
Hide comment
@TRBlount

TRBlount Aug 22, 2017

Contributor

Could this be updated to current trunk before being merged?

Contributor

TRBlount commented Aug 22, 2017

Could this be updated to current trunk before being merged?

Allow countermeasures to pulse at regular intervals instead of globally.
Adds a new "+Pulse Interval:" countermeasure field that enables the new behavior; all countermeasures that don't have this field defined still use the old behavior of the global frame counter.

This changes countermeasure logic quite a bit, but I attempted to mitigate performance implications by re-using an existing traversal of the object list in order to build the list of active countermeasures each frame. If any countermeasures are actively pulsing in a frame, the object list is traversed again, looking for homing weapons. Each homing weapon then goes through the active countermeasure list and checks to see if it got decoyed. Most of this central logic is unchanged from the old behavior, although no longer separated into two functions, and it should be more efficient since it's using a prepared list of active countermeasures instead of traversing the object list looking for countermeasures for every homing missile (which are themselves found by traversing the object list).
@MageKing17

This comment has been minimized.

Show comment
Hide comment
@MageKing17
Member

MageKing17 commented Aug 23, 2017

@TRBlount Done.

@asarium asarium merged commit 2039815 into scp-fs2open:master Aug 24, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@MageKing17 MageKing17 deleted the MageKing17:feature/countermeasure-pulse-interval branch Aug 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment