Looking at that wiki page, they definitely calculate damage similar to how I described it:
From the wiki:
(Base Damage) × (Distance and Randomness Modifier) × (Resistance/Vulnerability Modifiers) × (Splash Modifier)
They do a good job explaining what the different modifiers are on the wiki, but:
Base Damage: This is the damage a specific projectile causes. Generally when talking DPS it would be this number multiplied by the rate of fire of the projectile. This would be tied generally to the type of bullet rather than the gun (as the wiki states), since in some games weapons would have multiple firing modes (like a sub machine gun with a grenade launcher attached).
Distance + Randomness: This is a multiplier used to reduce damage as the projectile collision occurs further away from the bullet's point of origin. I didn't read about the randomness aspect, but I imagine a slight randomness is applied to this multiplier.
Resistance/Weakness: This is a multiplier that would be used to reduce/improve effectiveness of a weapon against specific characters (i.e. a fire dragon is strong against fire magic, but weak against ice), or for example power up bonuses (i.e. armor or ammo upgrade).
Splash Modifier: This is for explosions, it is as I described in my original reply.
These would most likely all be tuned separately, but yes, the designers probably had the engineers build sliders (or some tool) to adjust all of these values. Lots of playtesting would have been done to get the numbers just right, and often values are adjusted post-ship if balancing issues are discovered.
An example of the calculation described above would be, assuming you are 15 feet away and the opponent has picked up body armor:
Shotgun:
Base Damage: 100
Distance Modifier: 1.0 (0.5 at 25 feet, 1.5 at 10 feet --> 1.0 at 15 feet)
Resistance Modifier: 0.5 (due to body armor)
Splash Modifier: 1.0 (since it's not an explosive weapon there should be no splash damage adjustment).
Result: 100 x 1 x 0.5 x 1 = 50 damage
But if you were 5 feet away and he had no armor:
Base Damage: 100
Distance Modifier: 1.5 (0.5 at 25 feet, 1.5 at 10 feet --> 1.5 at 5 feet)
Resistance Modifier: 1.0 (due to no armor)
Splash Modifier: 1.0 (since it's not an explosive weapon there should be no splash damage adjustment).
Result: 100 x 1.5 x 1 x 1 = 150 damage
I would create sliders to tune rate of fire for each weapon, and the base damage for each weapon (you can always add as many modifiers as you need after the fact). Then to increase an individual weapon's damage per second, you would tune either the rate of fire of the weapon and/or the base damage. You would then need to tune things like clip capacity to balance things such as reloading.
It's very hard to mathematically balance a game, but it is a good tool to start with.