In the Starcraft 2 campaign, there is a unit called the “diamondback”. It’s a sort of hovertank, and it is useful for hunting down other vehicles because it is armed with dual “rail guns” that can fire while it moves. In the game, the rail guns are depicted as some sort of energy weapon: they fire hot blue beams at the target. This disturbed me because rail guns actually do exist, and they most certainly don’t fire blue energy beams!
So what’s a real rail gun and how do they work? I’m so glad you asked!
To understand how a railgun works, we need to review some basic physics. In fact, railguns are often used as a homework problem in introductory electricity and magnetism! Whenever you have a current flowing through a wire, it generates a magnetic field that circles around the wire. You can use the “right hand rule” to visualize this. If you point the thumb of your right hand in the direction of an electrical current, the direction that your fingers curl is the direction of the magnetic field produced by the current. In a railgun, the power source, the two parallel rails and the conductive projectile form a circuit, with the current flowing from the power supply out one rail, crossing through the projectile, and then back along the second rail. If you use the right hand rule, you can convince yourself that the magnetic field between the rails points upward in between them, as shown in this diagram:
So, we have a current flowing across the projectile, from one rail to the other, producing an upward magnetic field between the rails. When you have a current flowing in a magnetic field, that actually results in a force on the thing carrying the current. That force is perpendicular to the current and the magnetic field, and also follows a form of the “right hand rule”. Point the fingers of your right hand in the direction the current is flowing (in the case of our projectile, it is flowing across the projectile from one rail to the other) and then partially close your hand so that the fingers are now pointing in the direction of the magnetic field (upward for our railgun) and your thumb will point in the direction of the resulting force. For the railgun, the force is along the rails, away from the power supply.
This force is what propels the projectile out of the railgun. The result is a gun that doesn’t use any explosives, but can launch a projectile at enormous speeds. The larger the current, the larger the force on the projectile, and the faster it goes! The rails themselves also are subjected to a huge amount of force trying to push them away from each other, but a well-designed railgun would be able to withstand that.
Railguns aren’t science fiction: they actually exist. The US Navy has tested prototypes of a system that would be able to hit targets hundreds of miles away, and an experimental system developed by the Institute for Advanced Technology has a prototype that could punch right through a tank. The problem with current railguns is that the rails wear out due to the intense heat and forces that they have to withstand for every shot.
Railgun projectiles are much simpler than missiles or even bullets because they don’t contain any explosives. Instead, they do damage because they hit their target at extremely high speeds, and the kinetic energies involved do as much or more damage than explosives. This makes the projectiles much cheaper and safer to store, and if they could be made small enough to be mounted on a vehicle like the diamondbacks in Starcraft 2, they would also be easier to aim than a traditional gun simply because their bullets travel faster. (For very long distance firing such as for the Naval prototypes you still have to account for pesky things like the rotation of the earth, just like regular cannons.) Reloading might also be faster since there wouldn’t be an empty cartridge to eject after every shot.
In many ways, the role that the railguns play in Starcraft 2 makes sense: they are intended to take down armored vehicles and can aim and fire rapidly on the fly. This fits perfectly with the advantages that real-world railguns would have over traditional guns! Current railguns are still in development, but I see no reason why in the future there shouldn’t be railguns suitable for the role depicted in Starcraft. My only real complaint about the railguns in Starcraft 2 is that they look like blue energy beams! Maybe they fire so fast the projectile is turned into a beam of plasma? Or maybe blue beams just look cool. I suspect the latter.