Defender Drone

July 13, 2012 by Terry

Some people have asked for a defense drone kind of weapon, so I put this one together. Nominally, it stays close to your ship to protect you from weapons fire, but it goes on the offensive when you are too close to enemies. It has enough shield energy to bash through a lot of stuff, but when the shield energy runs out it gets destroyed easily.

I don’t yet know if this weapon will make it into the final game. That will depend entirely on how well it is received during playtesting.

The most difficult part of designing the Defender Drone was getting the navigation to work properly. Since it is always circling your ship, it tries to maintain an arc of just the right radius to move to its target. Managing this radius accurately was very tricky, and without accuracy it was missing way too many targets. To control the radial acceleration, I ended up using a proportional-integral-derivative (PID) controller, which is a mathematical tool commonly used in autopilots and other industrial applications that need high precision controllers. Relying on naive control methods, the radius was usually off by twenty percent or more. A well tuned PID reduces the error to under five percent in about a second, which seems to work well enough for hitting targets. I will try to tune it a little better later on, though.

Leave a Reply