Simulating Bullets

Polymatic Labs
8 min readNov 10, 2019

--

A lot of shooter games take a very simplistic approach to bullets. This ranges from a simple ray-trace having final say on what is hit, to some games that simulate bullet drop and bullets piercing through thin objects. However, having some more in-depth knowledge about how bullets should behave, the bullet physics in games always struck me as over-simplified.

This isn’t to say that we’re going to simulate every effect either, but we’ll be going more in-depth than the average simulation would.

For the purpose of keeping things efficient, we’ll be looking for “single-step” solutions, meaning that we should have a non-iterative approach to finding the forces applied to the bullet for each physics step. And for the purpose of keeping things realistic, we’ll avoid the use of magic numbers as much as we can.

We’ll also be sticking to the metric system as much as possible. However, because most public firearms documentation comes from the United States, a lot of raw data and measurements will unfortunately be in imperial units.

When it comes to firearms, bullet behavior is usually split into 3 categories: Internal ballistics, External ballistics and Terminal ballistics. We’ll discuss these categories separately below.

Internal Ballistics

We can skip over this category almost entirely, because the outcome of it will be pretty much identical every time. The important factors here are muzzle velocity and the rifling twist rate, which will give us the bullet’s angular velocity at the muzzle. Muzzle velocity especially is very-well documented for different types of ammunition and barrel lengths, and the twist rate is a constant for a given gun, so both can be given as a configuration parameter. The angular velocity, in radians per second, can then be calculated as:

External Ballistics

External ballistics are a little more complicated. There are mainly three forces that affect the bullet’s trajectory:

  • Gravity — a constant downwards force
  • Drag — loss of velocity as the projectile cuts through the air
  • Magnus Effect — a lateral force caused by a combination of the projectile’s angular velocity and lateral air velocity

Gravity

This effect is perhaps the easiest to simulate, because it causes a constant downwards acceleration regardless of any other parameters of the projectile.

Drag

Drag is relatively well-understood. The major pitfalls here are the fact that bullets typically travel at supersonic speeds and that the drag coefficient does not stay constant in the trans- and supersonic territories. There seem to be some formulae floating around somewhere that describe this effect, and is used for some online bullet calculation tools, but we couldn’t actually find such a function anywhere. However, we do have some sources showing experimental data, and so we can try to re-construct the curve ourselves.

The idea here was to construct a “correction factor” for the drag coefficient of a projectile, which we can multiply into the drag equation to improve the accuracy of the simulation. This is the result:

This isn’t a perfect re-creation of the experimental data, but it’s good enough for our purposes. The equation for that curve is:

Where M is the mach number, and a, b, c and d are constants. The constants can be tweaked per projectile to best fit the drag model for that particular projectile. Most projectiles will likely be configured to best fit a G1 or G7 standard projectile, which both have very distinctive drag coefficient curves that can be replicated with the above equation.

Once we have that, we can calculate the drag force using the drag equation including the above factor:

Magnus Effect

The Magnus Effect is a force caused by air passing over a rotating object. In external ballistics, the effect comes into play as the projectile starts to fall, and causes the projectile to accelerate sideways.

As an interesting side-note, once the projectile is moving sideways, it actually begins to generate lift due to this effect.

The basic equation for the strength of the force is essentially just handed to us on the Wikipedia article. We essentially only have to combine the two parts and rearrange them a little:

The only difficulty is that this gives us the magnitude of the force, but leaves out the direction. The way we worked around that is by multiplying ω by the forward-pointing vector of the projectile and taking the cross product between ω and v:

With this, we have a force vector we can apply to the projectile.

Results

The results look promising. Below is the simulated trajectory of a projectile modeled after a .50 BMG round. According to the scale of the simulation, the projectile traveled around 3150 meters before hitting the ground:

As of right now, we’re still looking to verify if these numbers seem realistic or if we’re way off. But the results look like what we would’ve expected.

Terminal Ballistics

This is where things get tricky. Terminal ballistics are messy — it’s a mix of huge amounts of energy being dispersed, incredibly high forces, and projectile and target material being torn to shreds in a fraction of a second. And unfortunately, while the forces generated by an impact are well-understood and well-documented, they tend to assume that the materials involved in the collision do not fail.
Likewise, material strength properties for different types of stress are well-known, but there doesn’t seem to be much tying those concepts and numbers to what happens when a bullet hits something.

This is something that we’re currently still developing, so a lot of the information below is subject to change. I’ll add the relevant math once we’re ready to share it.

This makes it somewhat difficult to model bullet impacts accurately, especially for someone like myself who isn’t very knowledgeable on the topic to begin with. With this in mind, below is my best attempt at modelling the physics involved accurately.

In general, a material can be put under 3 types of stress:

  • Compressive Stress — Forces compressing the material.
  • Tensile Stress — Forces putting the material under tension, or trying to stretch it.
  • Shear Stress — Forces trying to “slide” the material past itself.

With that, we can attempt to tackle the following questions:

Will the projectile enter the material?

First and foremost, it’s important to consider whether or not our projectile will even enter the material, or if it should just bounce off. In other words, we need to decide if the material will fail either in compression across the surface of the impact, or fail by shearing along the circumference of the impact.

Compressive failure is likely to only occur in materials that contain voids for the material to collapse into. A good example of this is wood, but all materials including concrete and slate exhibit this property to some extent. Metals and glass, on the other hand, likely do not, and are very unlikely to fail in compression.

Shear failure occurs on materials that fail due to compression, or thin materials where the projectile is able to push an entire chunk of the material through. Shear failure can only occur under those two conditions. However, considering the compressive strength of materials is usually significantly higher than the tensile or shear strength, we can assume shear failure occurs in the case of a compressive strength failure.

We’ve entered the material — how far do we go?

So, we know for a fact that the material has failed due to shear stress. The next important factor is to know if the material also failed in compression. If not, that means the projectile is essentially pushing a chunk of the material out of the other side of the object, and that the projectile will be exiting the material.

If the material also failed in compression, things are a little more complicated. The material will continue to fail in compression until the projectile stops, or until the remaining material is thin enough to fail purely by shear or tensile stress instead.

We’re exiting the material — how fast is the projectile now?

This is perhaps the simplest portion of the terminal ballistics simulation, because all of the information we need is determined in one of the previous steps.

If the material failed purely via shear stress, we can model this as an inelastic collision between the projectile and the chunk of material that was removed from the target. This will give us the exit velocity.

If the material fails in compression, we can model this as a constant force applied to the projectile until the point where a remaining chunk of material is removed, and model this last chunk as an inelastic collision to give us the exit velocity.

Projectile Deformation

There are certain types of ammunition that are designed to deform on impact. Notable examples of this are Hollow Point (designed to increase their diameter on impact to disperse energy more quickly) and Armor Piercing (designed to have their copper jacket stripped to expose a tungsten core to decrease cross-sectional area) ammunitions. Both of these can be modeled by adjusting the projectile diameter, length and density upon the first impact.

We do not plan to simulate projectile fragmentation and spalling, as this would quickly create a large number of projectiles and affect game performance.

Transfer of momentum

In any collision, we know the initial and final velocity, as well as the initial and final mass of the projectile. We can use this information to calculate the amount of momentum that should be transferred into the target based on these values.

Any thoughts, ideas and feedback from you guys are welcome.

Author:
anna@polymatic-labs.com
Director, Software & Electrical Engineer

--

--

Polymatic Labs

We give projects the resources, flexibility, and focus to make their ideas and goals happen.