Profile image

Flak AA Autoturret (broken)

77.0k 232287168147825  4.2 years ago
11,661 downloads



^click^ for target plane to test with

I woke up today and the new beta featured a new parameter: fuseInput. This immediately got me thinking, and I came up with this. While the new auto fuses can simply be timed to the linear distance, I decided on something more complicated as cannon projectiles are pulled down by gravity. As well as that, I also upgraded the old turret's simple funky trees with something much more... fun... to compensate for the force of gravity.

It works best at longer range and has a built in range of 20km. This can be put on planes if gyros are used instead of rotators.


Source Function


Function Explanation

Thanks to SnoWFlakE0S for linking the proper equations to do this:


Function Physics Explanation

(But no Funky Trees! So people who took Physics can understand easily!)
Thanks to SnoWFlakE0S for linking the following equation:

This allows the cannon to take account gravity to hit (X,Y). These being calculated on a plane based from the turret's heading using trig.
The heading is nearly the same as the old turret. Basically, the fun two-vector projectile motion but simplified and solved into 1 equation with the variables I need/have.

The fuse is different than a linear calculation, which would calculate the amount of time the shell would reach linearly (Distance/Speed). Since the projectile is a two-vector object, we find the horizontal vector and then divide by the total horizontal distance to attempt to explode near the target, unlike the normal linear method which would result in the shell exploding too early as the linear path would be shorter than the parabolic one.

To become cool and reason why it looks so intimidating, is we need to find the horizontal vector of the already gravity-corrected turret angle, (as opposed to the target’s component of horizontal displacement, which is from straight TargetElevation) meaning we plug the entire equation into the trig.


Want to know the license for these FUNKtions? look at a rotator lol

Spotlights

General Characteristics

  • Successors 11 airplane(s) +105 bonus
  • Created On Windows
  • Wingspan 8.2ft (2.5m)
  • Length 10.9ft (3.3m)
  • Height 12.4ft (3.8m)
  • Empty Weight 4,832lbs (2,191kg)
  • Loaded Weight 9,125lbs (4,139kg)

Performance

  • Wing Loading N/A
  • Wing Area 0.0ft2 (0.0m2)
  • Drag Points 5843

Parts

  • Number of Parts 67
  • Control Surfaces 0
  • Performance Cost 309
  • Log in to leave a comment
  • Profile image

    And the code given by WNP78 worked better at shooting down planes.

    Pinned 4.2 years ago
  • Profile image

    So.. how so i modify this so it Can work with a different projectile velocity than the preset one that idk how to modify

    2.0 years ago
  • Profile image

    I fixed it

    +4 3.3 years ago
  • Profile image
    3,066 Zue5s

    Its only weakness is planes that is constantly changing distance from the turret like planes that are moving away or towards the turret

    3.4 years ago
  • Profile image

    The gun starts to slowly detatch

    3.4 years ago
  • Profile image

    I love this

    3.8 years ago
  • Profile image
    30.0k TriStar

    Ok it something to do with discord idk but its smthn
    CCC - cu clux clan..... jjust kidding its a specific group of people that collaborate on builds, idk how to join

    SPMC - simplpelanes master chat, only the best simpleplanes masters (it says it...) can join @CedC

    3.9 years ago
  • Profile image
    2,721 CedC

    what is CCC and SPMC?

    3.9 years ago
  • Profile image

    May i ask is it still working?

    4.0 years ago
  • Profile image
    10.9k Belloaka

    Nice, can't wait to download this.

    4.0 years ago
  • Profile image
    25.8k VinFage

    Does the AI work with this turret?

    4.1 years ago
  • Profile image
    12.0k Hellosss38

    Ah ok
    @NumbersNumbersTheMan

    4.1 years ago
  • Profile image

    The elevation / azimuth is aight. But the fusing (that determines when the flak should explode, preferably next to the enemy) is unreliable and explodes too far or too short sometimes @Hellosss38

    4.1 years ago
  • Profile image
    12.0k Hellosss38

    Why is it broken

    +1 4.1 years ago
  • Profile image
    33.5k tsampoy

    Impressive!

    4.1 years ago
  • Profile image

    It's time for AUTOMATED BROADSIDES and epic anti air defense!!!!

    +1 4.1 years ago
  • Profile image
    930 SPak

    @AMEIBOXIA3 输了

    4.1 years ago
  • Profile image
    0 80TH

    @SPak 你没输入代码,它能运行?

    4.1 years ago
  • Profile image

    If you make it so it has no recoil then the fire rate goes up.

    4.1 years ago
  • Profile image
    15 JOTAR0

    @Vladimir1944 i think i can help

    4.2 years ago
  • Profile image
    930 SPak

    It has no air-to-air capability

    +1 4.2 years ago
  • Profile image

    Need help for my attack helicopter project with an automated belly turret

    4.2 years ago
  • Profile image

    @NumbersNumbersTheMan The entire problem, I assume, is that the target is moving and the fuse is set to detonate at the point the plane was when the shells fired instead of where the plane is when the shell passes by the plane... Because even with the Snowflake code the shells still pass by the plane (even the slowest vanilla bushplane, that is) and harmlessly detonate 50 feet (if not 100 or more) behind it...

    4.2 years ago
  • Profile image

    @ThomasRoderick unfortunately, the function

    ((cos(TargetElevation) * TargetDistance)/(cos((atan(((pow(2000,2)) - (sqrt((pow(2000,4)) - (9.81 * ((9.81 * pow((cos(TargetElevation) * TargetDistance), 2)) + ((2 * ((sin(TargetElevation) * TargetDistance))) * pow(2000,2)))))))/(9.81 * (cos(TargetElevation) * TargetDistance))) + rate(TargetElevation) * (TargetDistance / 2000)) / 1) * 2000))
    

    has issues when setting horizontal component fuses. I will take a look some day, but I am busy. A guaranteed fuse that will be a little short and more inaccurate as targets get farther is a linear fuse, targetDistance / 2000

    4.2 years ago
  • Profile image

    There's one slight problem: the shells detonated nowhere near the enemy plane, so unless we can get a direct hit it's not really working... Is it due to lag?

    4.2 years ago
  • Log in to see more comments