Skip to content
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

Missile Guidance Overhaul #4562

Merged
merged 3 commits into from
Nov 15, 2016
Merged

Missile Guidance Overhaul #4562

merged 3 commits into from
Nov 15, 2016

Conversation

PabstMirror
Copy link
Contributor

  • Headers
  • Modern params/private
  • Moved laser seeker range check to ace_laser (so we don't waste time on lasers we can't see)
  • Added seekLastTargetPos config (enabled for javelin). If seeker loses LOS of target, will still continue to last known position.
  • If seeker returns no position, missile will fly straight instead of trying an attack profile (useful for DAGR)

Picked up some performance gains on the main guidance PFEH:
Before: Average: 0.55397s / 1222 = 0.453331ms
After: Average: 0.436127s / 1269 = 0.343677ms

@PabstMirror PabstMirror added kind/enhancement Release Notes: **IMPROVED:** kind/cleanup Release Notes: **CHANGED:** labels Oct 17, 2016
@PabstMirror PabstMirror added this to the 3.9.0 milestone Oct 17, 2016
@PabstMirror PabstMirror mentioned this pull request Oct 21, 2016
_seekerType = _seekerTypesCfg select _i;
if ((isNil "_seekerTargetPos") || {(vectorMagnitude _seekerTargetPos) == 0}) then {
// Seeker returned nil / bad pos
if (_seekLastTargetPos && {(vectorMagnitude _lastKnownPos) != 0}) then {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think !(_lastKnownPos isEqualTo [0, 0, 0]) is faster than (vectorMagnitude _lastKnownPos) != 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks about even in my testing but not enough precision to say for sure:
20x of each:

x3 = !([0,0,0] isEqualTo [0,0,0]);
x4 = !([0,0,1] isEqualTo [0,0,0]);

0.0639 ms 0.065 ms 0.0636 ms

x3 = (vectorMagnitude [0,0,0]) != 0;
x4 = (vectorMagnitude [0,0,1]) != 0;

0.0633 ms 0.0617 ms 0.0628 ms

x3 = (vectorMagnitudeSqr [0,0,0]) != 0;
x4 = (vectorMagnitudeSqr [0,0,1]) != 0;

0.0631 ms 0.0615 ms 0.0633 ms

But [0,0,0] is kind of a magic value, so isEqualTo might be clearer

@BaerMitUmlaut BaerMitUmlaut merged commit 21502d7 into master Nov 15, 2016
@BaerMitUmlaut BaerMitUmlaut deleted the mgCleanup branch November 15, 2016 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Release Notes: **CHANGED:** kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants