Tutorial: Making the AI fly

Besides introducing all sorts of weaponry to KSP, one of the main features of BDArmory is the AI Pilot. The AI is capable of everything from taking off to advanced flight maneuvers, and can easily be set up to fly in formation or engage in combat with other AI-controlled craft. In this brief tutorial, aimed at newcomers, we'll get you started by showing you how you can get the AI to fly your planes.

## 1: The basics

First of all, you're going to need an airplane. There are no requirements as far as size or power are concerned, as the AI Pilot is capable of flying pretty much anything – from tiny scout planes to oversized freight craft. It will even use airbrakes and different engine modes when needed. As a general rule, if you can handle it, so can the AI.

Besides being able to fly, your aircraft is going to need two critical parts attached. These are the Weapon Manager, which is the core component of BDArmory, and the AI Pilot Flight Computer , which will handle the piloting itself. These can be placed anywhere on your craft, including inside cargo bays.

Once the AI Pilot Flight Computer has been placed somewhere, a good idea is to go to the Action Groups menu in the SPH, select the part, and bind the action "Toggle Pilot" to one of the action groups – so that you can easily turn the AI Pilot on and off without right-clicking the part mid-flight.

## 2: Setting it up

   Although very clever, the AI is not automatically aware of the particular flight characteristics of the aircraft it is controlling. A slow plane with short, stubby wings will behave differently from a swept wing jet fighter. For this reason, you will most likely have to fine tune how the AI controls each plane design you want it to fly.

Right-clicking the AI Pilot Flight Computer part, either in the SPH or in the world, will bring up the settings pane. This is where you will later set the various parameters that affect the way the AI will handle your plane. Each individual setting is described in detail on the AI Pilot Flight Computer page.

For your first flight, there's no reason to start adjusting these settings, though. Instead, a good idea can be to just go out into the world, so you can figure out how close or off the mark the default settings are for your plane.

## 3: First flight

Once you have a plane with the requisite parts installed, put it on the runway, and prepare to launch. Activate the AI Pilot either by using an action group or by right-clicking the AI Pilot Flight computer, and turn on the engines. The AI should immediately start off down the runway to take off. At the takeoff speed defined by the AI Flight Computer settings pane, it will try to pitch up and start climbing.

As soon as you are in the air, the pilot will try to climb to the default altitude. If the climb is too steep, you might want to change some of the settings – such as the steer limiter setting, as described on the AI Pilot Flight Computer page, to prevent the AI from pulling back 100 percent on the stick.

At the default altitude, the AI will now start a turn and level out, as it will try to orbit the area it is in. If the AI is not turning hard enough, try increasing the steer factor setting – and vice versa. If you use FAR, it might be a good idea to crank down steer factor from the default, while increasing steer damping, as well as setting a lower top speed than default (especially if you have very powerful engines).

If the plane is now happily orbiting over the KSC, congratulations! Now have your AI Pilot to fly in a straight line using the Wing Command module, and keep playing with the Flight Computer settings until it moves like it should. Make sure to read the tweaking tips on the AI Pilot Flight Computer page.

## 4: Finishing touches

When you have found the settings that work for your plane design, make a note of them, and make sure you enter them into the Flight Computer settings pane for that plane inside the SPH – so you don't have to manually tweak them every time you launch a new one.

With all this in place, you're more than ready to move on to setting up your own AI battle in the skies .