Home   Help Search Login Register  

Author Topic: Anti-Air ammo with time-range fuse  (Read 7836 times)

0 Members and 1 Guest are viewing this topic.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Anti-Air ammo with time-range fuse
« Reply #30 on: 15 Feb 2009, 13:02:45 »
With mando gun you define the dispersion (it is an automatic gun) but the shells explode by proximity. Anyway mando gun is designed to work for automatic systems with even minimum reaction time and able to intercept incoming missiles, but probably the code in these scripts will help you with your calculations for the 5" guns.

Offline Centerbe

  • Members
  • *
Re: Anti-Air ammo with time-range fuse
« Reply #31 on: 15 Feb 2009, 13:44:44 »
Of course, i will study your gun code... also if like i say before i dont need a proximity fuse, and for a newbie like me is difficoult understand in detailed how one of your expert script real work. Some things will rest for me certainly misunderstood. Thanks very much for your interesting in this project, you are true generous and patient people.

PS: i have corrected some bad string of code, but i have the same an error on "_difference" definition string.
I think i have bad defined "_target" variable as "_x".

Other problem, i have find a command for get a number from the config files (GetNumber), but exist a command for Set a variable into the config file?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Anti-Air ammo with time-range fuse
« Reply #32 on: 15 Feb 2009, 13:59:38 »
You cannot modify the config, it is read-only.
and the _x inside a {} forEach array loop represents each of the elements of the array (one after another in the loop), so _x inside a {} forEach is a "reserved" word.

Offline Centerbe

  • Members
  • *
Re: Anti-Air ammo with time-range fuse
« Reply #33 on: 15 Feb 2009, 14:14:33 »
well, i hope exist a way to set an object explode at a varible time..... or all this work is useless.

for _target, i will define it inside the {} forEach array ... or like something else...i try.Thanks.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Anti-Air ammo with time-range fuse
« Reply #34 on: 15 Feb 2009, 14:48:54 »
You can cause an "on-air" explosion at the position of an object (the shell) at any time. What you cannot do is just to force an object to explode n seconds after its creation. You may download Mando Missile, inside warheads folder you will find several scripts that cause mid-air explosions, including smoke effects, etc. For each round fired by your gun you need to calculate the flight time and generate one of these explosions at shell's position after the desired delay (and removing  the shell itself). Mando Gun shells also generate mid air explosions, but quite small for a 5inch gun.

Offline Centerbe

  • Members
  • *
Re: Anti-Air ammo with time-range fuse
« Reply #35 on: 15 Feb 2009, 15:29:26 »
Great.... i will use it! Thanks
Umm im working on target discrimination now... i get an error if i define;

Code: [Select]
_diff = ((_atarget select 0)-(_aweapon  select 0)) atan2 ((_atarget select 1) - (_aweapon select 1));

but i havent if define;

Code: [Select]
_diff = (_atarget - _aweapon) atan2 (_atarget -_aweapon);

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Anti-Air ammo with time-range fuse
« Reply #36 on: 15 Feb 2009, 16:43:39 »
in the code _aweapon and _atarget are already angles, not sure why do you keep applying atan2 to calculated angles.

Offline Centerbe

  • Members
  • *
Re: Anti-Air ammo with time-range fuse
« Reply #37 on: 15 Feb 2009, 17:19:53 »
see the test file, it show only times of possible targets. Look at time explosion (1.6sec):

http://files.filefront.com/FireTestmpg/;13292800;/fileinfo.html

or

http://www.youtube.com/watch?v=MOiZc6hZJB8

But _aweapon and _atarget arent angles in X and Y ? I use atan2 for subtraction of X angles and Y angles separately... or not?  ???

« Last Edit: 15 Feb 2009, 17:41:33 by Centerbe »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Anti-Air ammo with time-range fuse
« Reply #38 on: 15 Feb 2009, 19:43:54 »
Look at the angles, variables and angle diff in the picture.

Offline Centerbe

  • Members
  • *
Re: Anti-Air ammo with time-range fuse
« Reply #39 on: 15 Feb 2009, 20:44:18 »
Well, the script now work.... im tryng to understand how much is AI capable to follow with weapons directions the angles of targets. So i show the differences from the angles of weapons and the anlges of targets;

Code: [Select]
   
{
_target = _x
_atarget = ((getPos _target select 0)-(getPos _ship select 0)) atan2 ((getPos _target select 1)-(getPos _ship select 1));
_wvdir = _ship weaponDirection "5inch"; // If 5inch is any weapon ...
_aweapon = (_wvdir select 0) atan2 (_wvdir select 1);
_diff = _atarget - _aweapon;
_dist = _x distance _ship;
_times = _dist / 790;
_msg = _msg + format["Target:%1 - Range: %2\n", _x, _diff];  // show the differences of angles
} forEach _planes;
         hint format ["%1",_msg];         
The differences of angles are around +/- 5° for correct targets, but i think its relative to the AI capacity to follow them and the turrets agility. I can try to increase the turret velocity for more accurate aiming? Or i can try also to calculate differences of angles around X axis?
« Last Edit: 16 Feb 2009, 12:48:36 by Centerbe »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Anti-Air ammo with time-range fuse
« Reply #40 on: 16 Feb 2009, 20:20:22 »
Well, if the target is not just fling headon to the turret, then the AI will need to keep turning the turret, but for slow planes the angular velocity of the turret doesnt need to be any fast to keep the gun more or less aligned. But, if the 5inch muzzle vel is really that slow (790m/s) then it will require more than a second to reach the target at maximum operational range. Now lets suppose the Bf109s are aproaching headon to the Fletcher at 550 km/h, that means than in a second they have advanced more than 150m towards the ship and the detonation calculated time at firing time will be definitively wrong. The reason is the following, the AI aims to an intercption point, which is closer than the position of the target when the AI fires, but your calculated time is based on the position of the target, not on the interception point calculated by the AI.

Offline Centerbe

  • Members
  • *
Re: Anti-Air ammo with time-range fuse
« Reply #41 on: 17 Feb 2009, 12:46:51 »
True your considerations, but i see in many cases that differences of angles are +/- around 0.
I think this is possible when planes directions of movement (vector) arent much perpendicular at the ship positions. In extreme case the planes vectors coincides with ship positions, also the turrets Y aiming angles of predicted trajectory coincides with planes angles from ship. In the opposite case the the planes vectors of movement are perpendicular at the ship position, the turrets Y aiming angles are at max difference from the planes angles from ship (advance trajectory prediction). So, the max difference values from turrets and targets angles (advance trajectory prediction), are directly proportional at the targets velocity, and inverse proportional from the muzzles velocity and targets distances.

I think this system should be in crisis not only for time exploding but also for target discrimination with fast and close targets, and relative high angular velocity. At contrary time explosion setting will be in severe crisis when angular velocity are small, when planes vectors of movement are along the ship position. Times of explosion will calculated from the moment of fire, but planes distances from ship changes during shell flyng times, and at moment of interception planes will be more close or far respect previous calculation, shell will explode too many forward or behind the real target position. So, the difference between planes positions calculated and planes position of intercepting will be more in proportion at planes velocity, and inverse proportion of muzzle velocity.
« Last Edit: 17 Feb 2009, 15:22:59 by Centerbe »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Anti-Air ammo with time-range fuse
« Reply #42 on: 17 Feb 2009, 15:13:35 »
I would say definitively this system is not for ArmA AI. The ship needs to create barriers of flak with each mounting firing about 10~15 shells per minute, so, if you enter that area there are high probabilities of suffering heavy damage. But not to pinpoint single targets ZSU-style.

Offline Centerbe

  • Members
  • *
Re: Anti-Air ammo with time-range fuse
« Reply #43 on: 17 Feb 2009, 16:04:06 »
Umm i think some of this mental problems are silly. Now, i use a fixed time explosion... 1,6 sec if i remenber well, and like i show to you in movie, anti-air shell efficiency are the same good, very good. Its now work fine also if this kind of error is relevant, and at maximum of it. This because in this weapon neednt a real precision evalutation of times and targets distances... approximation work the same well. The same principle was in real, the old AA systems adopted a fire control based on simply radar device, in some aspect approximative, or in most case a manual time setting of shell, and it works well. Fletcher have a large amout of AA weapons 5 turret with 5inch cannon, 4 dual 40mm bofors and 8 20mm machine guns. Now with only 3 cannon turrets working, fletcher have however a good killing rate. The question isnt explode a shell at the same precise space target position, but simply approx around it. I can also use a manual time set for AA weapons, with a prefixed time of explosion example 1s, 1.5s, 2s ecc ecc

The collimation and discrimination of targets worries me more than explosion times.
However, in alternative i can write a code for a simple proximity fuse.

I need test the effective funcional of script.... how i can explode shells at given times? What is the command?
I must calculate times from shells creation to the predicted time.
Thanks very much...

PS: i have your msn contact... but u dont use msn?
« Last Edit: 17 Feb 2009, 16:13:37 by Centerbe »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Anti-Air ammo with time-range fuse
« Reply #44 on: 17 Feb 2009, 16:48:53 »
You need to add a "Fired" event handler, when the associated script is executed (automatically) you get the time and the shell (the object), you wait the desired delay and then you remove the shell and create a mid-air explosion. Use "search" option in this forum for "Fired" Event handler.