Page MenuHomeFeedback Tracker

[Feature Request] getFCSAimPoint
New, NormalPublic

Description

getFCSAimPoint
Description: Returns the position (in relative model coordinates ASL; coords with Target as objNull are given as if weaponDirection is [0, 1, 0] ) of the projected aimpoint for the given FCS of the current weapon. Returns are calculated based on the following cases of the weapon's ballisticsComputer config entry in WeaponsConfig:

  • ballisticsComputer = 0; // Aimpoint returned is aimPos of the particular target; objNull as Target returns [0, 0, 0];
  • ballisticsComputer = 1; // Aimpoint returned is of predicted impact point, were sights properly aligned; objNull as Target returns [0, 0, 0];
  • ballisticsComputer = 2; // Aimpoint returned is aimPos of the particular target, plus the added height of the zeroing to compensate projectile drop; objNull as Target returns height difference of bullet drop at zeroed distance versus straight line distance; [0, zeroingDistance, bulletDropHeight];
  • ballisticsComputer = 4; // Aimpoint returned is predicted intercept point that's needed to be aimed at; objNull as Target returns [0, 0, 0];
  • ballisticsComputer = 8; // Aimpoint returned is the bomb CCIP impact point; as displayed/calculated on a plane's HUD; objNull as Target returns the bomb CCIP impact point;
  • ballisticsComputer = 16; // Aimpoint returned is of predicted impact point, were sights properly aligned; objNull returns stored impact point based on laser and range, [metersLeftRightOfWeaponToImpact, metersForwardToImpact, metersUpDownToImpact];

Syntax 1: Unit getFCSAimPoint Target; <OBJECT>, <OBJECT>; Syntax 1 uses currentWeapon of the Unit;
Syntax 2: Unit getFCSAimPoint [Target , WeaponName]; <OBJECT>, <OBJECT>, <STRING>; Syntax 2 uses listed weapon on the chassis; If Unit doesn't have the weapon of WeaponName, returns [0, 0, 0];

Return: ImpactPointASL ; <ARRAY>; Position ASL in model reference space;
Return: ImpactPointASL ; <ARRAY of ARRAYS>; for each ballisticsComputer type, e.g. ballisticsComputer = 4 + 2;
ARRAY = [ Number Type of FCS , Position ASL in model reference space of returned point];


Reasoning:
The command getFCSAimPoint provides script-makers with the capability of using the same engine-level predicted points of impact. This can facilitate the usage of lockCameraTo for automatic target tracking, access to CCIP computations for dropped bombs (or even setup for a script based Constantly Calculated Release Point and automatic release) in a quick engine-level command, rather than having to rely on inefficient stepwise SQF or extension-based scripts to calculate these impact points.

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Scripting

Event Timeline

LLukeL created this task.Aug 28 2022, 11:38 PM

unitAimPosition is for finding the point on a unit's model that AI will aim at. This request is for finding the point in space a vehicle's FCS is currently trying to aim at. There's a little overlap in the 0 and 2 cases, but the other cases are well outside what unitAimPosition can provide - it's coming at it from the opposite angle.

NikkoJT removed a subscriber: NikkoJT.Aug 29 2022, 6:15 PM

For clarity, I'll be using example cases (numbers are not exact, but demonstrative) for such scenarios for both the unitAimPosition command and this one; the ones where they'd provide an identical result, or one that can extrapolate an identical result are in bold underline.

For this command, there's two classes of usage, one without any target (objNull as target), and one with a target. Categorically, the Class 1 usage cannot be identical to unitAimPosition because there is no Target given or selected (except for where [0, 0, 0] is returned, but that would only be equivalent to unitAimPosition objNull, a rare usecase for the command). However, with this command there's still valuable information that could be of use even if no target is provided..

As demonstrated by the twelve possible use cases for this command below, versus the two for unitAimPosition, only two of the use cases for getFCSAimPoint will return an identical result to unitAimPosition. Both instances being the Case 1 usage, with and without a target. The remaining usages (with Cases 5 and 6 yielding the same result regardless of target) means that there's eight more unique usages of this command that are not available to scripters, despite these values (or something close to them) being present at engine level.

Given the eight distinct instances wherein this command would provide additional useful information to coders/scripters that they would not otherwise have access to, without writing lengthy, laggy, or complex scripts and/or code to do the calculations already being done at the engine level, I believe that the inclusion of this command would open several doors to the community in terms of creative usage for these commands.



unitAimPosition Class 1 Usage:

Case 1 unitAimPosition objNull;
returns [0, 0, 0];


unitAimPosition Class 2 Usage:

Case 1 unitAimPosition:
unitAimPosition provides the center of geometry aimpoint of the vehicle it's called with.



getFCSAimPoint Class 1 Usage

Case 1 getFCSAimPoint : ballisticsComputer = 0; objNull target:
returns [0, 0, 0];

Case 2 getFCSAimPoint : ballisticsComputer = 1; objNull target;
returns [0, 0, 0];

Case 3 getFCSAimPoint : ballisticsComputer = 2; objNull target;
returns [0, 1000, -8.67513]; Hypothetical weapon whose bullet drop is -8.67513 meters at 1000 meters zeroing.

Case 4 getFCSAimPoint : ballisticsComputer = 4; objNull target;
returns [0, 0, 0];

Case 5 getFCSAimPoint : ballisticsComputer = 8; objNull target;
returns [0, 585.283, -27.25]; CCIP impact point on terrain of a bomb dropped from a dive. Impact point is 585.283 meters ahead, and 27.25 meters below the plane, in model reference space (not from flat, world-relative coordinates!)

Case 6 getFCSAimPoint : ballisticsComputer = 16; objNull target;
returns [-10, 232, 17]; Added lead based on laser range and tracked speed stored in the unit from last Lase Range command. Correction is read such that to hit a the hypothetical lased point at 232 meters without the FCS, the unit would need to aim left 10 meters and up 17.


getFCSAimPoint Class 2 Usage
(All coordinates are assumed to have the Target at Vector [0, 1, 0] from the Unit, and the Unit stationary for ease of hypotheticals; the actual command should compensate for cases outside these parameters.)

Case 1 getFCSAimPoint : ballisticsComputer = 0; with Target unit:
returns aimPos of Target;

Case 2 getFCSAimPoint : ballisticsComputer = 1; with Target unit:
returns aimPos Target vectorAdd [7.07, -7.07, -0.001] to compensate for hypothetical target moving towards the Unit and to the right at 10m/s;

Case 3 getFCSAimPoint : ballisticsComputer = 2; with Target unit:
returns aimPos Target vectorAdd [0, 0, 8.384] to compensate for bullet drop to target based on target range where bullet drop is 8.384 meters;

Case 4 getFCSAimPoint : ballisticsComputer = 4; with Target unit:
returns aimPos Target vectorAdd [12.5006, 0.0625, 7.6622] to compensate for a target at 1000m, moving left to right at 10m/s, with a shell that will travel an average speed of 800m/s over course of flight.

Case 5 getFCSAimPoint : ballisticsComputer = 8; with Target unit:
returns [0, 585.283, -27.25]; Returns identical to Case 1 usage, as no target is required for a CCIP.

Case 6 getFCSAimPoint : ballisticsComputer = 16; with Target unit:
returns [-10, 232, 17]; Returns identical to Case 1 usage, as data is based off the stored Lase Target information, not any actual selected target.



Therefore, this command is demonstrably different from unitAimPosition in most cases, cannot be used the same way in those cases, and cannot give the information this command's inclusion would provide.

It has also just occurred to me that there exists instances of multiple simultaneous types of FCS systems being employed for a single weapon/unit, for this reason the Task is edited as follows:

Return: ImpactPointASL ; <ARRAY>; Position ASL in model reference space;

becomes

Return: ImpactPointASL ; <ARRAY of ARRAYS>; for each ballisticsComputer type, e.g. ballisticsComputer = 4 + 2;
ARRAY = [ Number Type of FCS , Position ASL in model reference space of returned point];

LLukeL updated the task description. (Show Details)Aug 29 2022, 10:16 PM