Profile image

Autoleading AA Turret

73.2k 232287168147825  1.8 years ago
45,765 downloads

click top gif for a VERY useful target plane by blue0bull (trust me the AI likes this plane)


Yet another beta tech demo. This time, it is a static AA turret (but can be mounted on a moving land vehicle provided the ground is flat or sea vehicle) that calculates the lead of the enemy aircraft; thus, the automatic aiming will not miss and there is no need for manual adjustment like the old turret. Spawn in, spawn your enemies, and the turret will do the work.

Limitations

This suffers from "triangle error", where the turret's gunnery is slightly offset from the information provided from the cockpit's location. I have thought of and drafted a function to solve this based on Law of Sines and Law of Cosines but I have not implemented it yet. Also, it only works on flat ground. Moving land vehicles are ok though. The AI can control it but it won't fire the guns (unless you damage the AI so it keeps firing the guns). This is only designed to work with the gravityless projectiles of guns.

I think it will work on ships as long as your ships do not list.

The function (click to access):


The function is fully free (it isn't that good though).

How auto-lead works

We take the rate of change of heading and assume the craft will keep that same rate of change constant. Then we calculate how long the bullet will take to get to the target's distance. Finally, we multiply the rate by the time to get the amount of correction for a successful intercept (assuming the enemy keeps its same rates). This means if your enemy is not constantly changing its course (including just going in a circle), you will have big chances to kill it with this device.

PS: It shoots down a lot of different types of planes, not just slow props. Try it out!


Addendum: AI Control

It works now, exactly like the original.

link to the AI - capable turret

Thanks to MysteryTimeTraveler and Darjeelings183 for coming up with this solution.


Coming Soon: PARALLAX

Now turrets don't have to be right above the cockpit... you can have more than one now

 (((TargetHeading - ((sign(Heading)<0)?(360+Heading):Heading)) + (rate(TargetHeading) * (TargetDistance / 2000))) < -90 | (((TargetHeading - ((sign(Heading)<0)?(360+Heading):Heading)) + (rate(TargetHeading) * (TargetDistance / 2000))) > 90)?((asin((sin((180 +  ((TargetHeading - ((sign(Heading)<0)?(360+Heading):Heading)) + (rate(TargetHeading) * (TargetDistance / 2000))))) * TargetDistance) / sqrt((TargetDistance * TargetDistance) + (16.25 * 16.25) - (2 * TargetDistance * 16.25 * cos((180 +  ((TargetHeading - ((sign(Heading)<0)?(360+Heading):Heading)) + (rate(TargetHeading) * (TargetDistance / 2000)))))))) + 180) / 180):((asin((sin((180 +  ((TargetHeading - ((sign(Heading)<0)?(360+Heading):Heading)) + (rate(TargetHeading) * (TargetDistance / 2000))))) * TargetDistance) / sqrt((TargetDistance * TargetDistance) + (16.25 * 16.25) - (2 * TargetDistance * 16.25 * cos((180 +  ((TargetHeading - ((sign(Heading)<0)?(360+Heading):Heading)) + (rate(TargetHeading) * (TargetDistance / 2000))))))))) / -180)

(ignore this for now, it is coming soon)

Spotlights

General Characteristics

  • Successors 26 airplane(s) +231 bonus
  • Created On Windows
  • Wingspan 8.2ft (2.5m)
  • Length 10.6ft (3.2m)
  • Height 13.6ft (4.1m)
  • Empty Weight 2,424lbs (1,099kg)
  • Loaded Weight 6,717lbs (3,046kg)

Performance

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

Parts

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

    @Brendorkus 20 dollars basic plan, 50 dollars premium, 100 dollars gold tier
    anyways, people have asked, credit is not needed and you could claim it as your own if you like. still flaws to be fixed and worked out.

    Pinned 1.8 years ago
  • Profile image

    Hello - I’ve set a range of 5km so your target should be closer than that. If you open the turret up you can change this by changing the 5000 in overload of the heading rotator. @Loldydu374

    Pinned 1.8 years ago
  • Profile image

    Addendum: AI Control

    It works now, exactly like the original.

    link to the AI - capable turret
    Thanks to MysteryTimeTraveler and Darjeelings183 for coming up with this solution.

    Pinned 1.8 years ago
  • Profile image
    352 Mach99999

    Can I use this in a build?

    13 days ago
  • Profile image
    1,134 Charris969

    @232287168147825 when Ice Base screwed up…

    +1 2 months ago
  • Profile image

    im gonna use the rotators for my next build ok?

    3 months ago
  • Profile image

    That is because it is rigged to only work a a ground turret but with few changes to the equation it can be fixed, note that only the pitch rotating one suffers from this problem so you should be able to fix it by comparing them to each other@Zakhaev245

    6 months ago
  • Profile image

    Dose this thing still work if it is moving quite fast

    6 months ago
  • Profile image

    @232287168147825 I think the updat did something to the AI turrets aim, you wanna do anything abt that?

    7 months ago
  • Profile image

    do more of these

    8 months ago
  • Profile image

    I would like to know how you managed to make the tower give a 360°, because even with the Mods I can't, it always stops at 180°. Note: I'm using your idea to make a World War II AA.

    10 months ago
  • Profile image

    老铁,你的密集阵被B站上某个伞兵盗了!快上b站看一下吧,这是他的视频:BV13h41167LR

    +5 10 months ago
  • Profile image

    Bro,your work have been stolen from this video!!!Please watch this video on bilibili:BV13h41167LR

    10 months ago
  • Profile image
    15 Drmiami

    tip:do not fire at the target over you at the time.----from a player who was destroyed like this for two times

    one year ago
  • Profile image

    Thank you very much for this

    one year ago
  • Profile image

    @CrazyPenguin1306 Same bro, when i try to shoot a truck with it, it always shoot above it

    one year ago
  • Profile image
    8,711 Mynameis190

    @232287168147825 Can this ciws shoot a missile

    +1 one year ago
  • Profile image
    541 WWIIgeek

    How do you adjust the turret for different muzzle velocities?

    +1 1.2 years ago
  • Profile image

    When I tried using the rotators to have a smaller version of an auto aiming turret it never shoots at the target it always shoots above it or nowhere near it...did I do something wrong or what?

    1.3 years ago
  • Profile image

    I know how to make this as capable 1 spawn them anywhere Whit the aggressive mode

    1.4 years ago
  • Profile image
    29.2k SyntheticL

    @232287168147825 May I use this turret on my ships?

    +5 1.4 years ago
  • Profile image

    I like it. ill test all autoturrents

    1.4 years ago
  • Profile image

    @232287168147825 When I tested this it didn't rotate, only the vertical rotation worked.

    +6 1.4 years ago
  • Profile image
    492 Mon0009

    @232287168147825 what would I need to change to use this code upside down

    1.4 years ago
  • Profile image
    135 surajsahu

    @232287168147825
    can you help me in this i cant use this in high speeds my killer turrent

    https://www.simpleplanes.com/a/0mbbw4/Killer-turrent

    1.4 years ago
  • Log in to see more comments