Translating a Fortran F-16 Simulator to Unity3D

I recently purchased the textbook “Aircraft Control and Simulation” by Brian L. Stevens, Frank L. Lewis, and Eric N. Johnson1. This book covers the control and simulation of aircraft. It’s really dense and frankly hard to understand. As far as aerodynamics texts go, it’s pretty typical.

One interesting item in the appendices of the book is the source code for the simulation of an F-16. It has a flight model, based on scale model wind tunnel data. The flight model consists of a dozen lookup tables and the math equations to make it fly.

The only problem: it’s written entirely in Fortran.

Read more

Creating a Flight Simulator in Unity3D Part 3: Weapons and AI

Now that we have the flight mechanics and HUD, we can start working on the weapons and AI. The AI will have all of the same capabilities and limitations as the player. It’s plane will have identical stats and it will use the same weapons.

The AI will be simple, but still capable of shooting you down. It will have logic for aiming and using it’s weapons optimally, for avoiding the ground, and for maintaining a reasonable amount of energy.

Read more

Creating a Flight Simulator in Unity3D Part 1: Flight

I’ve been playing Ace Combat and Project Wingman recently. This inspired me to write my own flight simulator using Unity3D. I wanted to make a flight sim with more depth than the arcade flight sims, while still being accessible.

You can think of realism as a spectrum. On one end is Ace Combat and at the other is more serious sims like Digital Combat Simulator. While researching I found Tiny Combat by Why485. This game sits somewhere in the middle of the spectrum, which is basically exactly what I want. The game requires the player to understand concepts like energy management without needing several semesters worth of classes to get the plane off of the ground. It’s got a pretty slick art style too.

So I set out to make my own. Here’s a demo based on what this blog series will cover:

This post is also available in video form: https://www.youtube.com/watch?v=7vAHo2B1zLc

Read more