Feature #11813

Ballistic calculator for arty

Added by conKORD over 4 years ago. Updated about 4 years ago.

Status:Closed Start date:07/09/2010
Priority:Normal Due date:
Assignee:Sandiford % Done:

10%

Category:Integration
Target version:-
Component: Affected Version:
Close Reason:

Description

I propose my addon of ballistic calculator to implement in ACE.

Current state: pre-release.

Features:
No need to have precalculated ballistic tables.
BalCa automatically calculates needed azimuth and elevation to hit place selected on map.
Rangefinder similar with tankFCS, added for debug, will be disabled in release.
OA compatible.

Most important here - formula to calculate elevation. Input - ammo info (initspeed, airfriction), distance to target, relative elevation. Output - needed elevation to reach target + estimated flytime.
It also can be used to generate ballistic information for sight adjustment for sniper rifles and tank FCS.

Currently ballistic calculator enabled for automatic grenade launchers (static and mounted on humvee and UAZ),BTR90,AAV,BMP3, mortars and cannons. To enable it to other vehicles - add ballistic_calulator = 1; to vehCfg.

Restrictions
Equation of bullet movement solved for two different cases - horizontal speed >> vertical speed and vertical speed >> horizontal speed. So it provides precise solution only for elevation 0-25 degrees (cannons, grenade launchers, etc.) and 70-90 degrees (for mortars it means range 0-1500m).
Requires CBA to work.

balca.pbo (15.6 kB) conKORD, 07/09/2010 20:29

arma.pdf (2.2 MB) conKORD, 07/10/2010 10:33

balca_v1.5_reloader.rar (69.3 kB) conKORD, 11/21/2010 14:48

balca_t.pbo (57.7 kB) conKORD, 11/21/2010 17:23


Related issues

related to A.C.E. for OA - Task #15251: Artillery Computer rounds for CSW mortars Closed 11/19/2010

Associated revisions

Revision bcaff64d
Added by Sickboy over 4 years ago

FIXED: Elevation/Direction change/reset by AI dummy who fires the mortars. refs #11813

History

Updated by conKORD over 4 years ago

ToDo:
Fancy interface =)
Get formula to calculate ballistic for rockets (Grad and MLRS). Need ideas why speed of rocked after using thruster != (_initSpeed+(_thrustTime*_thrust)).

Updated by q1184 over 4 years ago

Interesting formula you got there. How did you come up with it?

Updated by conKORD over 4 years ago

In short - I have 2 times integrate system of equation of movement in Maple. Alot of mathematics here - so boring.

Updated by q1184 over 4 years ago

  • Status changed from New to Assigned
  • Assignee set to q1184

Nice :) When I have more time, I'll check it out and see if it indeed can remove the need for ballistic tables. Thank you for the offer.
Regarding rocket motion equations - make sure to use sideairfriction as friction coefficient, not airfriction (it's ignored by rockets/missiles/bombs). The handling is different (sideairfriction is usually between 0 and 1, while airfriction is negative), but I don't know the exact formula.

Updated by Sickboy over 4 years ago

Re for artillery; Since the latest A2 OA Beta, there are new scriptingCommands/configEntries regarding Artillery(simulation), perhaps we are getting some engine support there after all ;)

Updated by conKORD over 4 years ago

q1184 wrote:

Regarding rocket motion equations - make sure to use sideairfriction as friction coefficient, not airfriction (it's ignored by rockets/missiles/bombs). The handling is different (sideairfriction is usually between 0 and 1, while airfriction is negative), but I don't know the exact formula.

For experiments I've set sidefriction to 0 (With current sidefriction speed of free falling is about 5 m/s). Airfriction from ammoCfg is 0.0005, but rockets ignores it.
Something else here . . .

Sickboy wrote:

Re for artillery; Since the latest A2 OA Beta, there are new scriptingCommands/configEntries regarding Artillery(simulation), perhaps we are getting some engine support there after all ;)

discreteDistance[] = {100, 200, 300, 400, 500, 600, 700, 800};
discreteDistanceInitIndex = 2;
?
And . . . is new BIS system really adjust sight or works like ACE sight adjustment?

Updated by conKORD over 4 years ago

Addon released, all works, now with fancy interface and it can be implemented as is.
http://www.armaholic.com/page.php?id=11265

Updated by conKORD over 4 years ago

Please set version to something. Looks like currently nobody see it.

Updated by rocko over 4 years ago

  • Target version set to 395

Updated by conKORD over 4 years ago

Thanx, rocko.

Version 1.1 released

Changes
  • Multilanguage support.
  • Now BalCa provides fire solution in entire range of elevation angles => we have high solution for cannons, mortars can shoot for their maximum range.
  • UI fixes.

Download
http://www.sendspace.com/file/k9weuq

Updated by gunterlund over 4 years ago

Very nicely done. Love the little lines that move to line you up. Now need an interface like the R3f system to pass this data to gunners. Right now its too easy to hit things :-)

Updated by conKORD over 4 years ago

Version 1.2 released
http://forums.bistudio.com/showthread.php?t=103129

  • Azimuth and elevation markers now calibrated. Extreme position of them means deflection 200 meters.
  • Horizontal and vertical axes now have marking, so possible to shoot, for example, 50 meter righter designated target location.
  • Be aware that those adjustment do not assumes altitude changes of terrain. To minimize deviation, caused by it, use high solution.
  • Calculations optimized.
  • BalCa now is item.
  • To use ballistic calculator you should be inside vehicle (cannon, mortar, grenade launcher) and have BalCa in inventory.
  • Also some vehicles (AAV,BMP3,BTR90) have built-in ballistic calculator

Updated by gunterlund over 4 years ago

Is this in ace or still standalone

Updated by conKORD over 4 years ago

BalCa 1.5
[+]Script preload, now BalCa will work faster.
[+]By default BalCa now enabled on BAF GMG (british version of Mk19)
[!]Minor issues in russian localisation.
[!]Demo mission changed to "Proving ground"
[-]In OA shell flytime has not been shown. Fixed.

Download
http://www.sendspace.com/file/esif7b

Updated by Sickboy over 4 years ago

Thanks conKORD, few remarks:
  • You've used ADDON = false; and later ADDON = true; however you haven't #define ADDON ballistic_calculator
  • You've not included all requiredAddons.
    • Causes the following rpt messages:
      Updating base class ->MGunCore, by ca\weapons\config.bin/cfgWeapons/MGun/
      Updating base class ->CannonCore, by ca\weapons\config.bin/cfgWeapons/D81/
      Updating base class ->LauncherCore, by ca\weapons\config.bin/cfgWeapons/RocketPods/
      Updating base class ->LauncherCore, by ca\weapons\config.bin/cfgWeapons/MissileLauncher/
      Updating base class ->Default, by ca\weapons\config.bin/cfgWeapons/ItemCore/
      Updating base class ->Truck, by ca\wheeled\config.bin/CfgVehicles/Ural_Base_withTurret/
      

      Solve by adding to cfgpatches requiredAddons:
      "CAData", "CAWheeled", "CATracked", "CAWeapons"
      And perhaps more, _E variants for EP1 etc.

Updated by Sickboy over 4 years ago

  • Category set to Integration
  • Assignee changed from q1184 to Sickboy
  • Target version changed from 395 to 1.7
  • % Done changed from 0 to 10

btw, very cool and neat addon. Love it!

Updated by conKORD over 4 years ago

Sickboy wrote:

Thanks conKORD, few remarks:
  • You've used ADDON = false; and later ADDON = true; however you haven't #define ADDON ballistic_calculator

Obsolete, currently it works without XEH, XEH_postClientInit.sqf will not be called, it can be deleted.

  • You've not included all requiredAddons. Once fixed you can removed the CfgAddons class completely.
    • Causes the following rpt messages:
      Solve by adding to cfgpatches requiredAddons:
      "CAData", "CAWheeled", "CATracked", "CAWeapons"
      And perhaps more, _E variants for EP1 etc.

Should I add
requiredAddons[] = {"CAData", "CAWheeled", "CATracked", "CAWeapons"};
to remove those RPT message?
_E variants - not, it will broke compability with vanilla A2.

PS thanks for response =)

EDIT: requiredAddons[] = {"CAData", "CAWheeled", "CATracked", "CAWeapons"}; is enough.

Updated by Sickboy over 4 years ago

NP, thanks for taking care!

Please try your ballistic calc together with; http://dev-heaven.net/issues/15251#note-13
  1. Build a mortar manually
  2. Interact with it, enable auto fire on load
  3. Get In and Pick and set target azimuth/dir based on ballistic calc
  4. Get out
  5. Load a single mortar magazine
  6. Repeat after firing :)

Updated by conKORD over 4 years ago

When AI dummy getting in empty mortar to fire - mortar turns to wrong direction.

PS here is fixed BalCa, deleted obsolete things and RPT messages.

Updated by Sickboy over 4 years ago

Thanks, yep, I know the limitations :)
Best test with self-built mortars, so that you don't first have to unload the 8round magazine.
Will hopefully be improved next days :) Ideas welcome :)

Updated by conKORD over 4 years ago

_dummy moveInGunner _MG;
_weap_dir = _MG weaponDirection _weapon;
_pos = getPosASL _MG;
_dummy doWatch [(_pos select 0)+1000*(_weap_dir select 0),(_pos select 1)+1000*(_weap_dir select 1),(_pos select 2)+1000*(_weap_dir select 2)];

PS my old trying to make function to align turret at needed direction, could be useful


            _veh = vehicle player;
            _pos = getPosASL _veh;
            _ndir = GET_AZIMUTH_TO_TARGET;
            _nelev = GET_LS;
            _playerunit = player;
            _orginalView = cameraView;
            //if (_orginalView == "GUNNER") then {_orginalView = "INTERNAL";};
            _watchPosition = [(_pos select 0)+(sin _ndir)*1000,(_pos select 1)+(cos _ndir)*1000,-(_pos select 2)+tan(GET_LS-GET_PITCH_TO_TARGET)*1000];
            _dummy = createAgent ["RU_soldier",[0,0,1000],[],0,"CAN_COLLIDE"];
            //hint format ["%1",[tan(GET_LS-GET_PITCH_TO_TARGET)*1000]];
            selectPlayer _dummy;
            (vehicle _playerunit) switchCamera _orginalView;
            sleep .1;
            //{_playerunit disableAI _x} forEach ["TARGET","AUTOTARGET","MOVE","ANIM"];
            _playerunit lookAt _watchPosition;
            _starttime = time;
            waitUntil {sleep .1;
                _weapvector = _veh weaponDirection (currentWeapon _veh);
                _cdir = ((_weapvector select 0)atan2(_weapvector select 1));
                if (_cdir < 0) then {_cdir = _cdir+360;};
                _celev = asin(_weapvector select 2);
                //hint format ["%1",[_cdir-_ndir,_celev-_nelev,time,_starttime+10]];
                (((abs(_cdir-_ndir)<1)&&(abs(_celev-_nelev)<1))||(time>(_starttime+10)))
            };
            sleep 1;
            selectPlayer _playerunit;
            sleep .1;
            //_celev = asin(((vehicle player) weaponDirection (currentWeapon (vehicle player))) select 2);
            //hint format ["%1",[GET_LS,_celev]];
            deleteVehicle _dummy;

Problem - doWatch is not very precise, error when aiming is about 1 degree, that's critical when firing on distant targets.

Updated by Sonsalt over 4 years ago

have you tried unit(s) doTarget target ?

Updated by conKORD over 4 years ago

Sonsalt wrote:

have you tried unit(s) doTarget target ?

Create logic at calculated position and doTarget dummy on it? It might work.

Updated by Sickboy over 4 years ago

doTarget, doWatch and lookAt all only seem to change direction but not elevation :)
So elevation/dir set good... dummy enters, resets elevation and direction,
execute lookAt etc; only direction is changed :D

Updated by conKORD over 4 years ago

Sickboy wrote:

doTarget, doWatch and lookAt all only seem to change direction but not elevation :)
So elevation/dir set good... dummy enters, resets elevation and direction,
execute lookAt etc; only direction is changed :D

doWatch also changes elevation. At least in vanilla A2 (I haven't tried it in OA)

Updated by Sickboy over 4 years ago

hmm, could not get that to work in OA, but will retry.
However I have found another solution! (dance).
Before you put the dummy in, run _mortar enableSimulation false;
then when the dummy is inside it, run _mortar enableSimulation true;
and voila; no changed elevation or direction!

Updated by conKORD over 4 years ago

Sickboy wrote:

However I have found another solution! (dance).
Before you put the dummy in, run _mortar enableSimulation false;
then when the dummy is inside it, run _mortar enableSimulation true;
and voila; no changed elevation or direction!

Magic :D

Updated by Sickboy over 4 years ago

Okay this is just brilliant together with your balca!
Are you okay if we suck up your balca addon into an ace system, like ace_sys_arty or even crewserved ?
Or do we have to keep your original PBO in tact?
Obviously full credits, and mention in changelog, regardless of method of integration.

Updated by Sickboy over 4 years ago

  • File ace_sys_crewserved-FireOnLoadOption_fixed_azimuth-elevation.7z added

Here's crewserved with fixed azimuth and elevation.
Best used with conKORD's balca :D

Updated by Sickboy over 4 years ago

Lol, now while testing im getting different results than before, ... looking into.

Updated by Sickboy over 4 years ago

  • File deleted (ace_sys_crewserved-FireOnLoadOption_fixed_azimuth-elevation.7z)

Updated by Sickboy over 4 years ago

For another day :-D

Updated by conKORD over 4 years ago

Sickboy wrote:

Are you okay if we suck up your balca addon into an ace system, like ace_sys_arty or even crewserved ?

I do not see the benefits of this, but here could be unexpected problem after integration of balca into one of existing addon. Only that here should be done - do fix for smoke, illum, laser-guided shells through "fired" XEH (currently it works only with enabled balca display) and put it into arty addon.

Updated by Sickboy over 4 years ago

Well it would mean we can adjust it when required and bring it up to ACE spec where required.
Obviously any improvements or changes made can be freely re-used by you.
However, as you wish, we can simply include your pbo and see how it goes.

Updated by conKORD over 4 years ago

Sickboy wrote:

Well it would mean we can adjust it when required and bring it up to ACE spec where required.

Of course, because I do not know some ACE specifications =) And one of goals of balca - be not depend on other addons, but in ACE easier to use some CBA functions.

Obviously any improvements or changes made can be freely re-used by you.
However, as you wish, we can simply include your pbo and see how it goes.

I think it will be better solution. But if really needed - you can include balca into other packages.

Updated by beta about 4 years ago

Hey conKORD, really interested in your ballistic computer code.

Would it be possible to make a function of your code so that you input the round, the desired target position, the gun position, the charge level, and you get required elevation, azimuth, and time of flight as an output? Would really appreciate it, as I'm trying to make a simple artillery targeting system with some constraints, but can't wrap my head around the whole ballistics calculations, and now can't use the BIS functions for it, as the ACE_ARTY rounds have been pulled.

Updated by conKORD about 4 years ago

beta wrote:

Would it be possible to make a function of your code so that you input the round, the desired target position, the gun position, the charge level, and you get required elevation, azimuth, and time of flight as an output?

W.I.P.

Updated by conKORD about 4 years ago

BalCa v1.6
[!]Removed RPT messages like Updating base class*
[+]Reworked addon structure, added function BALCA_FNC_GET_SOLUTION that will return needed elevation to engage designated target.

More info
http://forums.bistudio.com/showpost.php?p=1809040&postcount=47

Download
http://www.sendspace.com/file/3lpor4

Updated by Nou about 4 years ago

Do you do any compensation for the low velocity frame FPS? I looked at your code and didn't notice anything special, but did notice that its set to be about 5FPS to save for time in calculating.

Do my own testing I've found the difference at 10Km to be almost 10 mils in elevation between 5FPS and 60FPS (what the BIS calculator uses). That is a fairly substantial amount (if you drop it to 1FPS it goes all the way to 80 mils!). Not only till I upped it to 30 mils did I reach a comparable accuracy.

I am wondering because I'd like to do real time generation of btables (and cache them) so people do not have to create their own, but if the accuracy suffers to much I might just use the standard BIS pre-calculated ones.

edit

Another option I was thinking for the AFATDS stuff I am writing is to make it precalculate once and show it doing that in the GUI. I am afraid though it might desync clients if their game freezes up... :p

Updated by conKORD about 4 years ago

Nou wrote:

Do you do any compensation for the low velocity frame FPS? I looked at your code and didn't notice anything special, but did notice that its set to be about 5FPS to save for time in calculating.

Yes, it is my little secret =) Minor change in sim function and it can provide preciese solution with 10 FPS instead of 60 (and 2 FPS for high solution).

I am wondering because I'd like to do real time generation of btables (and cache them) so people do not have to create their own, but if the accuracy suffers to much I might just use the standard BIS pre-calculated ones.

BalCa preciese at every range.

edit

Another option I was thinking for the AFATDS stuff I am writing is to make it precalculate once and show it doing that in the GUI. I am afraid though it might desync clients if their game freezes up... :p

Freeze 0.1 second that can cause fnc_get_solution is no matter. And when airfriction == 0 it uses formulas, that's very fast.

Updated by Sickboy about 4 years ago

  • Assignee changed from Sickboy to Sandiford
  • Target version changed from 1.7 to 1.8

Sorry, we're still working out some details, and deciding on arty thingies.

Updated by Spyder001 about 4 years ago

AFATDS is a system for checking data more then computing it. I'm a 13F and I'm also on the team that does FEC (Fire Effects).

Updated by Nou about 4 years ago

Spyder001 wrote:

AFATDS is a system for checking data more then computing it. I'm a 13F and I'm also on the team that does FEC (Fire Effects).

Yea, was using it as an all encompassing term for the whole chain, including the BCS. Working on my interpretation of the AN/GYK-37 at the moment. Hard to find information on the interface though, so I am sort of winging it.

Updated by rocko about 4 years ago

  • Status changed from Assigned to In progress

Updated by rocko about 4 years ago

  • Target version changed from 1.8 to 1.9

Updated by conKORD about 4 years ago

Working someone on integration for now?

Updated by Sickboy about 4 years ago

Sorry about that conKORD, it has long been a bit unclear what direction we were going with the Artillery.
At this time it seems that the BI Artillery Computer, ordinary weapon handling, and the work in progress Artillery simulation system will suffice - while your balcal can still be optionally used by those interested.

Updated by Huggy about 4 years ago

Atm we can´t use ACE arty system prperly cause there is still the documentation missing for getting a fire solution.

Since BIS Arty computer and BalCa are not taking in account the different charges, we are not able to use/test the new munition-types.

Updated by Nou about 4 years ago

Huggy wrote:

Atm we can´t use ACE arty system prperly cause there is still the documentation missing for getting a fire solution.

Since BIS Arty computer and BalCa are not taking in account the different charges, we are not able to use/test the new munition-types.

This isn't really the place...

But still, look at todays update, check out the ACE artillery equipment section, there is a HMMV in there with the new computer. No documentation on it yet, but its pretty easy to get the grips on. Just remember to look at the log on the bottom of it, if you are screwing something up it will probably tell you there. :)

Updated by Sickboy about 4 years ago

Huggy wrote:

Atm we can´t use ACE arty system prperly cause there is still the documentation missing for getting a fire solution.

Since BIS Arty computer and BalCa are not taking in account the different charges, we are not able to use/test the new munition-types.

The documentation will come once the system is ready. 1.9 is few weeks away.

Updated by Huggy about 4 years ago

Nou wrote:

Huggy wrote:

Atm we can´t use ACE arty system prperly cause there is still the documentation missing for getting a fire solution.

Since BIS Arty computer and BalCa are not taking in account the different charges, we are not able to use/test the new munition-types.

This isn't really the place...

But still, look at todays update, check out the ACE artillery equipment section, there is a HMMV in there with the new computer. No documentation on it yet, but its pretty easy to get the grips on. Just remember to look at the log on the bottom of it, if you are screwing something up it will probably tell you there. :)

Thanks for the heads up Nou :o)

PS: Thank you Sickboy as well of course

Updated by conKORD about 4 years ago

Huggy wrote:

Since BIS Arty computer and BalCa are not taking in account the different charges, we are not able to use/test the new munition-types.

BalCa supports different arty charges.

Sickboy wrote:

At this time it seems that the BI Artillery Computer

Yes, BalCa were designed before BIS arty computer comes. But the time lost and now it is not so valuable.

Updated by Sickboy about 4 years ago

  • Status changed from In progress to Closed
  • Target version deleted (1.9)

Also available in: Atom PDF