Profile image

Tilt-proof Autoaim Railgun

51.4k JoshuaW  3.7 years ago
Auto Credit Based on JoshuaW's PID Autoaim + Railgun prototype

PLEASE UPVOTE IF YOU LIKE IT

please download from this link, it fixed some minor errors.

.
First of all, I would like to thank @SnoWFLakE0s and @krevedkopro for their help and information.
Part of the codes are based on @krevedkopro calculation, while I add my own solutions as well so the code is considerably shorter.
Unlike my previous railgun, this one no longer uses a PID function for aiming.

Introducing another member of Instantly delete your enemy series !

The new autoaim railgun.
6S1r1f.md.png

Aircrafts, tanks, warships, anything that can be locked, it stops existing anymore once you pressed the button.
Tilted terrains are no longer a problem, and shooting while moving at 100 km/h is just easy, come hell or high water, it's here to delete your enemies.
6S1N0H.md.png

The vehicle is equipped with speed control program , you set the desired speed with throttle input,it will automatically adjust engine power to maintain it.
6S127j.md.png
.

Controls

To fire, go to air-to-air or air-to-ground mode, select a target and hold Fireweapon button until it fires.

Roll: steering

Throttle: sets the cruising speed, 50% throttle = 90km/h, 100% throttle = 180km/h.

AG1: switch to a larger caliber with lower muzzle velocity (default gun 6000m/s, AG1 gun 600m/s )

.
A simplified version with normal cannons instead of railgun, in case it doesn't work well on mobile.
http://www.simpleplanes.com/a/HW8uEa/Autoaim-simplified

.
Demo video at https://www.bilibili.com/video/BV1154y1h7HD/

.
Rotators for autoaiming are intendedly painted orange, you are welcome to take them and study or use it for your own works ^_^
6S1pwj.md.jpg

UPVOTE IF YOU LIKE IT !!

Spotlights

General Characteristics

  • Predecessor PID Autoaim + Railgun prototype
  • Successors 3 airplane(s) +28 bonus
  • Created On Windows
  • Wingspan 41.1ft (12.5m)
  • Length 70.8ft (21.6m)
  • Height 32.4ft (9.9m)
  • Empty Weight 31,703lbs (14,380kg)
  • Loaded Weight 44,124lbs (20,014kg)

Performance

  • Power/Weight Ratio 0.305
  • Wing Loading N/A
  • Wing Area 0.0ft2 (0.0m2)
  • Drag Points 45882

Parts

  • Number of Parts 301
  • Control Surfaces 0
  • Performance Cost 1,464
  • Log in to leave a comment
  • Profile image
    51.4k JoshuaW

    Please download from this link, it fixed some minor errors.

    https://www.simpleplanes.com/a/2R30GS/Autoaim-Railgun-v1-1

    Pinned 3.7 years ago
  • Profile image
    0 jjosh3

    Cool

    1.4 years ago
  • Profile image

    Would it be possible for you to make an auto turret like this but for aerial gunships and bombers? I've been making a bomber for a while now and I've been trying to look up for any good auto turret codes for the rotators, but I haven't been able to find any that can work for my design. Can you help me out?

    +1 2.0 years ago
  • Profile image
    0 SMQW

    @JoshuaW

    2.9 years ago
  • Profile image
    18.9k SKDS

    B站来的i了i了😂😂😂

    3.3 years ago
  • Profile image
    5,218 krevedkopro

    @joshuaW
    hello again. I'm back to auto aiming now, and still can not catch what you did with vertical aiming.
    (see your answer beneath)
    Which way global CS affects all this, if at the stage of aiming angle definition we works fully in relative CS?
    Why you calculating vehicle top vector, if in relative CS it's a constant {0,0,1}?
    I've tryed using just formula for angle between vectors: cos(a) = dot product / product of lengths, but the result is just barrel shaking.
    P.S. i would be grateful if you can contact with me in discord for more convenient communication: kerved#9113

    +1 3.4 years ago
  • Profile image

    I took your railgun as a subassembly,put it on P-51 and in dogfight,i have 1-shot a target that was 22 km away!

    +1 3.4 years ago
  • Profile image
    197 pg821

    How can I adapt the codes for use with wing guns?

    3.4 years ago
  • Profile image
    51.4k JoshuaW

    @WIZARD2017 use this one for tanks

    3.7 years ago
  • Profile image
    51.4k JoshuaW

    @TankerWithATankard Thanks, that was exactly what I tried but failed

    3.7 years ago
  • Profile image

    诈尸了?忘了你是谁了???只记得你的FA2,药丸

    3.7 years ago
  • Profile image
    51.4k JoshuaW

    @krevedkopro First of all I'd like to thank you again for your document.
    The general idea is calculating the angle between target vector and vehicle top vector (local (0,0,1) in global CS) using a dot product.
    To get that top vector, I calculate the cross product of vehicle right vector(1,0,0) and vehicle front vector(0,1,0), with the sin(right,front) fixed to 1 it's an easy job.
    Most important, this method avoid the issue of atan(0/0) that would occur according to your document.

    3.7 years ago
  • Profile image
    5,218 krevedkopro

    @JoshuaW can you pls explain your method for vertical rotator? i don't have neither time and desire to do reverse-engineering, but it looks interesing.

    3.7 years ago
  • Profile image

    太帅了

    3.7 years ago
  • Profile image

    @JoshuaW i did but no button appears

    3.7 years ago
  • Profile image
    51.4k JoshuaW

    @Ruskiwaffle1991 you need to switch to air-to-air or air-to-ground mode to use a weapon

    3.7 years ago
  • Profile image

    @JoshuaW no fireweapon button shows

    3.7 years ago
  • Profile image
    51.4k JoshuaW

    @Ruskiwaffle1991 it should work in most cases, remember to hold the fireweapon button until it fires.

    3.7 years ago
  • Profile image

    aw, it won'5 work on mobile :( i want the railgun

    3.7 years ago
  • Profile image
    51.4k JoshuaW

    @DogstenAnkleheigh select a target and press fireweapons button for at least 1s

    3.7 years ago
  • Profile image

    How do i shoot it though @JoshuaW

    3.7 years ago
  • Profile image

    Cool build @JoshuaW @2

    3.7 years ago
  • Profile image
    51.4k JoshuaW

    @SnoWFLakE0s @krevedkopro Guys come check this out, I made it with horizontal rotator based on @krevedkopro calculations and vertical rotator with my own method, making the codes considerably shorter, and it works very well.

    3.7 years ago