Katie Richards

Ballistics System - Skip to the showpiece!

GitHub Repository

Overview

One of the modules in my second year at the University of Portsmouth is called Maths for Games. It focuses on implementing a variety of mathematical constructs in game engines, such as vectors and quaternions.

For the final assignment, I decided to go further than expected and created a ballistic system for the Unity Engine, which may be the first of its kind to be used in video games.

Note: This post is long and technical. You may want to take a minute before diving in.

I won’t fully explain the entire system here, but if anyone wants to collaborate on implementing it somewhere, feel free to reach out!


Background

One thing that has always frustrated me with shooter games is the lack of realism in their firearms. For as long as I can remember I have had a mild obsession with firearms technology, this combined with thousands of hours in VR and Flatscreen FPS games has resulted in quite a lot of frustration with ingame ballistic mechanics.

Just to emphasise my point heres a few examples of things ive encountered:

  • Enemies can’t shoot through a 1mm sheet of corrugated steel, but can shoot through a 2-foot-thick tree with handguns.
  • Enemy players are behind some metal stairs made using folded 2mm mild steel sheet and its about as strong as a tank
  • Thin household walls often being entirely impervious to projectiles and explosives

I understand that games often cut corners for gameplay feel and performance however I think its agreeable that some of these issues are frustrating and can really impede a players gameplay experience.

So, I decided to fix this using real-world physics and ballistic modeling, fast and efficient enough for multiplayer games adapted from various engineering fields.

Special thanks to Charles Schwartz for his help on this project. I highly recommend his book Quantitative Ammunition Selection if you too are interested in the study of terminal ballistics! (non-affiliate).


How Games Traditionally Handle Ballistics

Ok so onto the interesting stuff. Most games either use:

  1. Raycast projectiles
  2. Physically simulated projectiles

Both have pros and cons. For this project, I’m using physically based projectiles with a custom movement system.

The main benefit of raycast projectiles is their simplicity and consistency. As they just instantly draw a ray to see where a shot has landed its reasonably simple to sync them accross networks and scenes and they have a small performance impact traditionally as are just a vector calculation. The main downside of these however is that you miss out on a lot of what makes ballistics interesting. In their simplest implementations raycast projectiles dont have drop and cant be influenced by wind. They even travel instantly resulting in no need for the player to lead their shots.

Physically based projectiles are a unique beast. A lot of games do these differently and even this system will be using something which could be considered a physically based projectile, but in this section I just want to focus on rigidbodies. Some games will use full rigidbody physics for projectiles that need to have drop. This is often things such as RPG rounds or arrows. This is grossly inneficient due to the high amount of calculations required for rigibody objects, along with being inconvinient and often inconsistent when using them over the network due to physics inconsistencies. These are both things I will need to avoid with my system.

Ballistic Penetration in Games

Ballistic penetration is done very diffently accross most games, however it falls into 3 main areas usually.

  • Some games have no penetration (Rust).
  • Others use hard/soft material categories (Pavlov VR).
  • Some are more realistic, like Rainbow Six Siege or Escape From Tarkov, but even those just use fixed damage reductions if a bullet has gone through a material.

My Approach (features)

Material Interaction

With my system, bullets actually have velocity and this will be effected by the materials they hit.

  • There is no fixed subtraction either. Energy is calculated as the bullet impacts and exits a material.

Furthermore materials are not just metal or wood. They can be highly detailed with their own specific mechanical properties, thicknesses and even ages!

Bullet Properties

The system also accounts for a range of projectile properties including:

  • Velocity
  • Nose shape
  • Expansion on impact
  • Drag coefficient
  • Mass

And environmental factors like gravity, wind, and air density.


Demonstration

Here’s a video showing the system in Unity, firing a variety of projectiles at different targets.

Highlights from the video:

  • FMJRN projectiles (for comparison)
  • Handgun vs rifle cartridges
  • Wound cavity and energy delivery data (not yet visualized)
  • Realistic results, 7.62 / .308 penetrate armor better than 5.56 / 2.23
  • 5.7 rounds penetrate armor better than .45 ACP due to speed and drag

Future Work

I plan to combine this system with a detailed health system for what may become my attempt at making one of the most detailed ballistic systems in a video game. Full implementation will be part of my dissertation in mid 2026.