Maverick Hoziel

3D Missile vs Aircraft Engagement Simulator

This project is an interactive 3D simulation of a heat seeking missile chasing an aircraft over a 50 km by 50 km airspace. It runs in Python using NumPy and Matplotlib and animates the full engagement in real time.

The original open source code provided basic missile tracking and 3D plotting. I extended it into a full combat style scenario with radar, different aircraft types, bombs, flares, altitude changes, crash and escape conditions, probabilistic bomb accuracy, and a persistent scoreboard.


Screenshots

Main Engagement View

3D engagement overview

Missile Intercept Succesful

Missile Intercept

Missile Intercept Before Plane Drops Bomb

Missile Intercept Before Bomb

Bomb Impact Example

Bomb hit near enemy base

Successful Flare Spoof

Flares spoofing missile

Plane not Detected by Missile - Stealth

Stealth


Technologies


Scenario Overview

Each engagement simulates:

  1. An aircraft spawns on a random edge of the map and flies toward a randomly located enemy base.
  2. Radar attempts to detect the aircraft each simulated second using a per aircraft probability.
  3. Upon detection, a heat seeking missile launches and begins guiding toward the aircraft.
  4. When near the base, the aircraft drops a bomb that falls vertically. The bomb may or may not count as a hit depending on a per aircraft bomb hit probability.
  5. After bomb release, the aircraft switches to a more aggressive escape maneuver with turns and altitude modulation.
  6. The engagement ends if:
    • The missile hits the aircraft.
    • The aircraft escapes the XY airspace.
    • The aircraft crashes by dropping below 500 m altitude.
  7. The scoreboard updates and a new engagement begins automatically. Bomb hits only contribute to the payload counter when both the geometry and the probability check indicate a successful strike.

My Contributions

The original repository only contained basic missile tracking and 3D plotting.
I implemented all of the following systems.


1. Multiple Aircraft Types

Created a structured AIRCRAFT_TYPES system defining:

Aircraft currently implemented:

Each type flies differently, is detected differently, and has unique flare and bombing performance. For example, the B2 has very low radar detection probability and a high bomb hit probability, while the X15 is much harder to bomb accurately with due to its extreme speed.


2. Radar Detection and Missile Launch Logic

In the original script the missile simply chased the aircraft immediately.

My implementation adds:

This models realistic detectability. For instance, the B2 has the lowest detection probability.


3. Bomb, Enemy Base, and Hit Probability Mechanics

I added a fully new subsystem:

On impact, the bomb logic applies a probabilistic hit model:

This lets different aircraft feel distinct as bombers, even when they reach the same release point.


4. Post Bomb Escape Maneuver and Altitude Changes

After dropping the bomb, the aircraft transitions into a complex evasive maneuver:

This gives each aircraft a unique, realistic escape pattern.


5. Flares and Missile Spoofing Logic

Added full countermeasure behavior:

Outcome logic incorporates flare success in determining whether the aircraft can later escape or crash.


6. Crash and Escape Detection

Added two ways for engagements to end besides a missile hit:

Crash and escape indices are calculated after trajectory generation and marked visually.


7. Outcome Logic and Scoreboard

Instead of only detecting missile hits, I added a full decision system.

The possible outcomes:

Global counters track:

payload_delivered increments only when payload_recorded is true and the explosion time is reached. These values are displayed live on the animation window.


8. Visualization Enhancements

I added:

I also added adaptive frame stepping so the simulation stays smooth even with dense time resolution.


Code Structure

rotate_towards(current, desired, max_angle)

Clamps heading changes so aircraft cannot instantly rotate.

generate_new_engagement()

Responsible for:

init()

Initializes all Matplotlib artists.

update(frame)

Runs the animation:


Example Aircraft Configuration

AIRCRAFT_TYPES = {
    "A10": {
        "color": "orange",
        "flare_trigger_distance": 100.0,
        "flare_success_prob": 0.70,
        "bomb_hit_prob": 0.85,
        "speed_min": 2000,
        "speed_max": 2100,
        "curve_min": 5,
        "curve_max": 10,
        "max_turn_rate": 0.7,
        "radar_detection_prob": 0.50,
    },
    ...
}

Access to full code

Full code here