This site contains over 30 deep dive articles that explain how Aviator weaves its magic. If you want to learn how Aviator works under the hood, then this is the place for you.
See the quick start guide for some recommended starting points, or check out the following index of all the deep dive articles and jump straight in. The articles are presented in an order that makes sense for those wanting to unravel the inner workings of Aviator, so if you're wondering where to start, I recommend simply working your way down the list.
3D geometry
-----------
- Lines and points - The fundamental elements of Aviator's 3D world
- 3D objects - How Aviator manages trees, hills, aliens, towns and other 3D objects
- Placing objects on the map - Reconstructing the game's map from the data in the game code
- Rotation matrices - The four matrices that lie at the heart of Aviator's 3D model
- Rotating and translating points in 3D space - Converting between different frames of reference in 3D
- Visibility checks - Deciding which lines to draw on-screen, and which to hide
Flight model
------------
- The flight model - The maths behind the Spitfire's aerodynamic flight simulation
- Matching the code to the flight model - Tracking down the flight model features that are mentioned in the manual
- Stalling and recovery - How Aviator simulates a stalling plane and the recovery process
- Ripping the wings off - Modelling the high g-forces that can rip the wings clean off
- Take-offs and landings - The two most important (and dangerous) parts of every flight
- On-ground calculations - The calculations behind the plane's behaviour on the ground
- Flying skills - Flying under bridges and over main street
Dashboard
---------
- Clock hands and dial indicators - Drawing the clock-like indicators on the dashboard
- Hard-coded division in the dashboard routines - Using hand-tailored division code for fast calculations
The Theme
---------
- Alien feeding and growth patterns - The many stages of the alien life cycle
- Aliens attack Acornsville! - Planning an alien attack on civilisation
- Adding bullets to the world - Spawning bullets that leave tracer trails in the sky
- Detecting alien hits - The geometry behind aliens and their weak spots
- Explosions and turbulence - Destroying aliens at close range can have serious consequences
Graphics
--------
- Flicker-free animation through colour cycling - Using four colours to create super-smooth animated graphics
- Converting pixel coordinates to screen addresses - Going from (x, y) coordinates to screen memory addresses
- Line buffers - Caching line information for faster erasing
Main loop
---------
- Program flow of the main game loop - The sequence of events in the main game loop
- Scheduling tasks in the main loop - How Aviator does the right thing at the right time
Maths
-----
- Times tables and nibble arithmetic - Inside Aviator's multiplication algorithms
- Trigonometry - Calculating sine and cosine in the rotation matrices
- Random numbers - How Aviator generates random numbers
Other
-----
- The key logger - Making sure that every key press makes gets recorded
- Multi-byte variables - How Aviator stores multi-byte variables
- Source code clues hidden in the game binary - Snippets of original source code and what they can tell us