diff --git a/addons/aim9/CfgAmmo.hpp b/addons/aim9/CfgAmmo.hpp index eed1b3e652..bb6362c842 100644 --- a/addons/aim9/CfgAmmo.hpp +++ b/addons/aim9/CfgAmmo.hpp @@ -12,8 +12,8 @@ class CfgAmmo { class ace_missileguidance { enabled = 1; - pitchRate = 25; // Minium flap deflection for guidance - yawRate = 25; // Maximum flap deflection for guidance + pitchRate = 35; // Minium flap deflection for guidance + yawRate = 35; // Maximum flap deflection for guidance canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode @@ -56,8 +56,8 @@ class CfgAmmo { class ace_missileguidance { enabled = 1; - pitchRate = 40; // Minium flap deflection for guidance - yawRate = 40; // Maximum flap deflection for guidance + pitchRate = 90; // Minium flap deflection for guidance + yawRate = 90; // Maximum flap deflection for guidance canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode @@ -71,8 +71,8 @@ class CfgAmmo { defaultSeekerLockMode = "LOBL"; seekerLockModes[] = { "LOBL" }; - defaultNavigationType = "AugmentedProportionalNavigation"; - navigationTypes[] = { "AugmentedProportionalNavigation" }; + defaultNavigationType = "ZeroEffortMiss"; + navigationTypes[] = { "ZeroEffortMiss" }; seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] seekerAngle = 120; // Angle from the shooter's view that can track the missile @@ -101,8 +101,8 @@ class CfgAmmo { class ace_missileguidance { enabled = 1; - pitchRate = 40; // Minium flap deflection for guidance - yawRate = 40; // Maximum flap deflection for guidance + pitchRate = 100; // Minium flap deflection for guidance + yawRate = 100; // Maximum flap deflection for guidance canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode @@ -146,8 +146,8 @@ class CfgAmmo { class ace_missileguidance { enabled = 1; - pitchRate = 25; // Minium flap deflection for guidance - yawRate = 25; // Maximum flap deflection for guidance + pitchRate = 35; // Minium flap deflection for guidance + yawRate = 35; // Maximum flap deflection for guidance canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode @@ -190,8 +190,8 @@ class CfgAmmo { class ace_missileguidance { enabled = 1; - pitchRate = 40; // Minium flap deflection for guidance - yawRate = 40; // Maximum flap deflection for guidance + pitchRate = 50; // Minium flap deflection for guidance + yawRate = 50; // Maximum flap deflection for guidance canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode diff --git a/addons/manpad/CfgAmmo.hpp b/addons/manpad/CfgAmmo.hpp index 97edff0f8d..cf59197990 100644 --- a/addons/manpad/CfgAmmo.hpp +++ b/addons/manpad/CfgAmmo.hpp @@ -12,8 +12,8 @@ class CfgAmmo { class ace_missileguidance { enabled = 1; - pitchRate = 30; // Minium flap deflection for guidance - yawRate = 30; // Maximum flap deflection for guidance + pitchRate = 50; // Minium flap deflection for guidance + yawRate = 50; // Maximum flap deflection for guidance canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode @@ -56,8 +56,8 @@ class CfgAmmo { class ace_missileguidance { enabled = 1; - pitchRate = 20; // Minium flap deflection for guidance - yawRate = 20; // Maximum flap deflection for guidance + pitchRate = 42; // Minium flap deflection for guidance + yawRate = 42; // Maximum flap deflection for guidance canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index 4213aa667b..ab9b2fc80a 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -217,7 +217,7 @@ if (GVAR(debug_drawGuidanceInfo)) then { if (!isGamePaused && accTime > 0) then { private _ps = "#particlesource" createVehicleLocal (ASLtoAGL _projectilePos); - _PS setParticleParams [["\A3\Data_f\cl_basic", 8, 3, 1], "", "Billboard", 1, 3.0141, [0, 0, 2], [0, 0, 0], 1, 1.275, 1, 0, [1, 1], [[1, 0, 0, 1], [1, 0, 0, 1], [1, 0, 0, 1]], [1], 1, 0, "", "", nil]; + _PS setParticleParams [["\A3\Data_f\cl_basic", 8, 3, 1], "", "Billboard", 1, 3.0141, [0, 0, 0], [0, 0, 0], 1, 1.275, 1, 0, [1, 1], [[1, 0, 0, 1], [1, 0, 0, 1], [1, 0, 0, 1]], [1], 1, 0, "", "", nil]; _PS setDropInterval 1.0; }; diff --git a/addons/missileguidance/functions/fnc_seekerType_Doppler.sqf b/addons/missileguidance/functions/fnc_seekerType_Doppler.sqf index b1748896ed..0558f75408 100644 --- a/addons/missileguidance/functions/fnc_seekerType_Doppler.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_Doppler.sqf @@ -152,6 +152,10 @@ if !(isNull _target) then { _projectile setMissileTarget _target; }; +if (_expectedTargetPos isEqualTo [0, 0, 0]) then { + _expectedTargetPos = (getPosASLVisual _projectile) vectorAdd velocity _projectile; +}; + _targetData set [0, (getPosASLVisual _projectile) vectorFromTo _expectedTargetPos]; _seekerStateParams set [3, _expectedTargetPos]; diff --git a/addons/missileguidance/functions/fnc_seekerType_IR.sqf b/addons/missileguidance/functions/fnc_seekerType_IR.sqf index eda7d21f49..b9dea23974 100644 --- a/addons/missileguidance/functions/fnc_seekerType_IR.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_IR.sqf @@ -34,7 +34,8 @@ _seekerStateParams params ["_flareDistanceFilter", "_flareAngleFilter", "_tracki private _distanceFromLaunch = _launchPos distanceSqr getPosASLVisual _projectile; if (_distanceFromLaunch <= _seekerMinRange * _seekerMinRange) exitWith { - [0, 0, 0] + private _dir = _launchPos vectorFromTo getPosASLVisual _projectile; + _dir vectorAdd getPosASLVisual _projectile }; private _withinView = [_projectile, getPosASLVisual _trackingTarget, _seekerAngle] call FUNC(checkSeekerAngle); @@ -82,6 +83,16 @@ if (true || {accTime > 0 && !isGamePaused}) then { (_x isEqualTo _target && _trackingTarget isNotEqualTo _target) || { (_withinView && _canSee && _isFlare) } }; + private _frontAspectMultiplier = 1; + if (_trackingTarget isKindOf "Air") then { + private _targetVelocity = velocity _trackingTarget; + + private _directionToTarget = (getPosASLVisual _projectile) vectorFromTo getPosASLVisual _trackingTarget; + private _angle = acos (_directionToTarget vectorCos _targetVelocity); + + _frontAspectMultiplier = (((_angle / 60) min 1) max 0.3); + }; + private _relativeTargetVelocity = _projectile vectorWorldToModelVisual velocity _trackingTarget; _relativeTargetVelocity set [1, 0]; private _foundDecoy = false; @@ -93,7 +104,7 @@ if (true || {accTime > 0 && !isGamePaused}) then { _flareRelativeVelocity set [1, 0]; private _angleBetweenVelocities = acos (_relativeTargetVelocity vectorCos _flareRelativeVelocity); // further away targets are filtered out by assumption that target cant move instantenously - private _chanceToDecoy = 1 - (_trackingTarget distance _x) / _flareDistanceFilter; + private _chanceToDecoy = 1 - (_trackingTarget distance _x) / (_flareDistanceFilter * _frontAspectMultiplier); if !(_foundDecoy) then { if (_angleBetweenVelocities <= _flareAngleFilter) then { _considering = true; @@ -124,8 +135,20 @@ if (true || {accTime > 0 && !isGamePaused}) then { private _targetPosition = _trackingTarget modelToWorldVisualWorld getCenterOfMass _trackingTarget; +if (GVAR(debug_drawGuidanceInfo) && { _targetPosition isNotEqualTo [0, 0, 0] }) then { + if (!isGamePaused && accTime > 0) then { + private _ps = "#particlesource" createVehicleLocal (ASLtoAGL _targetPosition); + _PS setParticleParams [["\A3\Data_f\cl_basic", 8, 3, 1], "", "Billboard", 1, 3.0141, [0, 0, 0], [0, 0, 0], 1, 1.275, 1, 0, [1, 1], [[0, 0, 1, 1], [0, 0, 1, 1], [0, 0, 1, 1]], [1], 1, 0, "", "", nil]; + _PS setDropInterval 1.0; + }; +}; + _targetData set [0, (getPosASL _projectile) vectorFromTo _targetPosition]; _targetData set [2, 0]; _targetData set [3, velocity _trackingTarget]; +if (_targetPosition isEqualTo [0, 0, 0]) then { + _targetPosition = (velocity _projectile) vectorAdd getPosASLVisual _projectile +}; + _targetPosition diff --git a/addons/missileguidance/functions/fnc_seekerType_MCLOS.sqf b/addons/missileguidance/functions/fnc_seekerType_MCLOS.sqf index 0a1accf1c8..b9fed77d98 100644 --- a/addons/missileguidance/functions/fnc_seekerType_MCLOS.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_MCLOS.sqf @@ -17,12 +17,12 @@ */ params ["", "_args"]; _args params ["_firedEH", "", "_flightParams"]; -_firedEH params ["_shooter","","","","","","_projectile"]; +_firedEH params ["","","","","","","_projectile","_gunner"]; _flightParams params ["_pitchRate", "_yawRate"]; private _projectilePos = getPosASLVisual _projectile; -private _accelerationDirection = _projectile vectorModelToWorldVisual (_shooter getVariable [QGVAR(MCLOS_direction), [0, 0, 0]]); +private _accelerationDirection = _projectile vectorModelToWorldVisual (_gunner getVariable [QGVAR(MCLOS_direction), [0, 0, 0]]); private _returnPos = _projectilePos vectorAdd (_accelerationDirection vectorMultiply (_pitchRate max _yawRate)); _targetData set [0, _projectilePos vectorFromTo _returnPos];