Post news Report RSS Balancing Firearms

Developer Blog by Daniel "DysPatch" Miede. Balancing the weapons in Firearms: Source is quite an undertaking considering the vast amount of weapons that need to be balanced, as well as leaving room for weapons to be included in updates.

Posted by on

Overview

WARNING: This is an in-depth look at how the firearms in Firearms: Source are balanced in 2.0. This article is intended for those who are truly interested in the process of game design and who may be interested in how I approached this task. While most of the discussion is very topical at the beginning, towards the end I get into a lot of detail and may lose a few people. If you have questions about anything in this article, or would like me to elaborate on anything, do not hesitate to post your questions. I realize I may lose you along the way, but I tried my best to make sure anyone can give this article a read, given they have the time and patience.

Balancing the weapons in Firearms: Source is quite an undertaking considering the vast amount of weapons that need to be balanced, as well as leaving room for weapons to be included in updates. Much with all design decisions and balancing, I approached the weapon balancing from the high level, working with familiar terms, and then broke the weapons down into their respective categories to help divide the work flow so I could balance based on small achievable goals, and then eventually plugging in the numbers. One thing to remember is that there is no formula for balancing these weapons. You can try to create a function that would allow you to plug in values, but you will always be missing the human element which is a huge factor when it comes to how a weapon feels as well as making sure each weapon feels unique.

High Level Thinking

Before we even begin to consider balancing the weapons, we need to know what variables we will be able to play with, and what weapon classes will need to come into play. In Firearms: Source we have two types of variables that we give each weapon; those that we like to keep close to the real life counterpart like rate of fire (ROF), ammo capacity, and weapon mechanics like firemodes and whether it is open or closed bolt and then there are also those where we have much more room to play with like credit cost, damage (relative to cartridge), effective bullet distance, damage fade factor, minimum damage, and accuracy, recoil, and stance and movement modifiers. With these in mind, we can then categorize our weapons into their roles in FAS as the following: Pistols, PDWs, Shotguns, SMGs, Carbines, Assault Rifles, Battle Rifles, Machine Guns, and Sniper Rifles.

As you can see, we have each category defined very broadly based on their effective ranges. This gives us a great starting point as their effective range already helps us determine base accuracy values, mobility values, effective bullet distance, and damage fade factor values. How is this? Well, simply put, weapons that are meant for closer range combat should have higher mobility and less accuracy, and higher damage decay. Conversely, the opposite applies for the long range weapons. Already we have a good idea of how the weapons in these categories should act, and we will worry about the exceptions, or weapon outliers, later (those being weapons that work outside of their anticipated role).

With ROF, ammo capacity, weapon mechanics, base accuracy, base mobility, bullet distance, and fade factor all covered, we really just have credit cost, damage (maximum and minimum), and recoil still needing to be regarded. Recoil, I usually work with last due to FAS being primarily focused around accuracy as we have found balancing primarily with recoil causes frustration with new players. The recoil in FAS is used to give the weapon the feel of power and to balance automatic fire. Now, when it comes to damage, there are three main factors that come to mind: caliber of the cartridge, the rate of fire of the weapon, and the accuracy of the weapon. We don’t want to give 5.56 rounds all the same damage values, because then high ROF weapons will reign supreme unless given a crippling accuracy values. On the other hand, it seems a bit odd to give two 5.56 drastically different damage values just for the sake of keeping guns in the same category relatively accurate. There is a careful balance to be met, but usually higher ROF weapons will have slightly lower accuracy values and slightly lower damage values, and then the opposite applies to lower ROF weapons. Credit cost is then implemented to help influence the role of the weapon, as well as balance the overall effectiveness of the weapon. For example, the M82 is an extremely lethal weapon, as it can kill in one chest shot with precision. It has the greatest range of all the weapons and the least damage decay. One of its downfalls is a lack of mobility, and there is a combination of ways we can influence this. However, strictly concerning credit cost, we give the M82 the highest credit cost, limiting the amount of armor the player can get, as well as restricting them to a weaker sidearm. This then restricts their mobility because if they try to use the M82 as an assault weapon, more often than not, the player will lose the fight due to minimal armor and CQC firepower. Now that we know the role each variable will play in balancing, we can then move onto actual implementation.

High Level Thinking Summary: Understand the tools you have available for balancing, and use familiar terms when balancing. You can fill the numbers in later, but it’s important you understand the fundamentals of how each weapon should act in-game, in your native language.

Divide and Conquer

With more than 40 weapons in 2.0, I needed to find an efficient way to balance all of the weapons not just within their weapon classes, but relative to each weapon in the game. However, starting with completely arbitrary to fill in for all the weapons is calling for a massive headache, and you will end up getting nowhere and will be balancing in circles. I looked back on my computer science studies and decided to go for a divide and conquer approach. The goal here is to divide all of the work into increasingly smaller sets that are all balanced according to their own level. So, I split all of the weapons into their natural categories again (Pistols, PDWs, …, SRs), and created a spreadsheet that describes each weapon class in familiar terms (we are still thinking high level right now). Refer back to the range diagram, and you can extrapolate that Pistols will have excellent mobility but low accuracy, and high damage decay. I then did this for the rest of the weapon categories, making sure that each weapon category can complement another. We are not only considering accuracy and mobility, but base values for all of the variables described in High Level Thinking will be rated and balanced on each level. From there, we divide again and split the Pistols into Standard Pistols and “Niche” Pistols. The Beretta 92FS, Colt 1911, and Glock 20 all fit under the Standard Pistols, while the Desert Eagle, Raging Bull, and OTs-33 fall under “Niche” Pistols. From there, we have finally divided the weapons into their atomic form, the weapon itself. Each pistol will then have their own properties, again in familiar terms. From the top level to the bottom level, they are all ranked and balanced relative to only those on the same level.

Let’s take the Niche Pistols for example, consisting of the Desert Eagle, OTs-33, and Raging Bull. I put these weapons on their own scale for each variable. In regards to accuracy, I have a scale from very low accuracy to very high accuracy. However, these high and low values are scaled based on its parent group. So, while a Raging Bull may have very high accuracy and very low mobility, this is still only relative to Niche Pistol and Pistols in general. So, if there was a Carbine that falls into the very high accuracy rating, the Raging Bull and the Carbine will not have similar accuracy values due to Carbine’s having a greater base accuracy than pistols. One thing we need to be careful about, however, is the fact that the Raging Bull is an exception/outlier to the pistols and will have higher accuracy values that are outside the range of pistols.

I’ve probably have you confused right now, so I will go with an easier example. Consider the Sterling (SMG), and the G36C (Carbine). The Sterling SMG has been balanced to be a high accuracy SMG, and the G36C has been balanced to be a high accuracy carbine. The Sterling only has high accuracy relative to the other SMGs, as well as the G36C is relatively high accuracy to the other Carbines. If you look at Range Diagram 2, you’ll see that the SMGs and Carbines are fairly similar weapon classes and their effective roles overlap. However, you will notice that the highest effective range of an SMG lies in the average effective range of the Carbines. If you think of the M4 or SG552 being moderately accurate Carbines, the Sterling will have similar accuracies to those, but the G36C would have a much greater accuracy. Unfortunately, this opens a bigger can of worms in regards to overall weapon category balancing (other variables still make the weapons act differently despite similar accuracy) which I will leave to low level engineering.*

Additionally, adding weapons in future builds allows you to simply stick the weapon in the category it fits best. If I have all the weapons balanced for 2.0, and for 2.1, plan to add a new Carbine to the already existing 3 Carbines, I only need to balance the Carbine against the existing 3 Carbines, as it will still retain the properties of a Carbine. Therefore the new carbine will be balanced against the entire set of weapons because it still retains the inherited balance of what a Carbine is against the other weapon classes.

Divide and Conquer Summary: By splitting your workload into increasingly smaller sets, and balancing each set relatively, you are able to balance on the atomic level and have the comfort of knowing that they are also balanced in the broader scheme.

Low Level Engineering

Now, we finally get to the weapon dynamics and number crunching. With all of our weapon categories and firearms all balanced with familiar terms, we can now start putting numbers to those ratings. This part will take a little trial and error, but usually when you design and develop levels on the Source Engine for 5 years, you get a pretty good idea of engagement distances. I was able to approximate a lot of the base values for things like range and damage decay. For rate of fire, converting the rate of fire of a weapon into the “cycle time,” time between shots, is just a matter of dividing 60 (seconds) by the actual ROF of the weapon (dimensional analysis). Then of course, the ammo count is just matched to the actual magazine capacity according to your design document (if the GDD calls for a variant of the gun that has a smaller magazine, reflect that).

*Remember that can of worms I didn’t want to open up before, well here it is. I’ll go ahead and answer the question: “if the sterling and m4 have similar accuracy values, what separates those weapon classes?” You need to remember that we have many other variables that come into play, especially damage, mobility, and damage decay. Theoretically, a weapon in the SMG class can have similar damages to a Carbine, but the damage decay for a Carbine would be insignificant compared to that of an SMG. For the purpose of an easy example, let’s consider a linear damage decay system. If the SMG and Carbine have the same maximum starting damage, to make the weapons act in their proper weapon roles, we can give them different damage decay factors (slopes in the linear diagram), different effective bullet distances, as well as different damage clamps for the minimum damage. For instance, say the SMG and Carbine both start with 50 damage, but the SMG has an effective bullet distance at 500 units and the Carbine has an effective bullet distance at 1500 units. This means that anyone within those units will be dealt max damage. Going further then, the decay drops the weapon damage based on the damage decay factor. The 40 damage that the SMG deals, will drop linearly until it reaches the damage clamp, let that be 5 damage. The Carbine will have a much slower damage decay, which means that even if the Carbine and SMG decay started at the same distance, the Carbine would still do more damage over distance. And finally the minimum damage clamp would ensure that the Carbine deals 8 damage instead of 5 damage.

I think when it comes to balancing, accuracy values are one of the most important tools that you can use and will completely alter weapon roles. The above diagram shows an early example of how I took familiar terms for accuracy (low, medium, high), and assigned them values. The accuracy is determined by passing an X and Y value through a fairly unique algorithm developed by Cale "Mazor" Dunlap, that is similar to Gaussian vector cones. After playing with values and becoming comfortable with the bounds of the equation, I was able to assign arbitrary values in the spreadsheet. The spreadsheet that I made in excel saved me huge amounts of time, because I was able to tweak base values, and then the cells in the spreadsheet were automatically updated through some very basic Excel scripting. After playing with values in the spreadsheet, and testing the accuracy (without recoil) on the shooting range maps, I was then able to then distribute these values amongst the weapons. Throughout testing, these values have changed, but this was a great way for me to get values that were very close to my desired values.

I continued the method above for most of the values in FAS, from damages to mobility and stance modifiers. For damages, I was able to approximate based on my knowledge of our armor system, hitbox modifiers, what amount of damage is fatal, and how many hits each weapon category should generally take to kill an enemy. For example, if a player has a 2.5x headshot multiplier with 100 HP and a helmet that absorbs 50% of the damage; if I want a DMR to kill a player in two headshots at all times, I know that the damage must be equal to or greater than 80 [ 100 / (2.5 * 0.5 ) ]. And you must also remember the linear damage decay graph, and that 80 damage will only be fatal at a distance less than or equal to the effective bullet distance (range).

Most of the weapon balancing was completely redone for 2.0, and one of the biggest fixes has been the inclusion of movement penalties, or mobility modifiers. Essentially, a mobility modifier is just a value that is multiplied with the current accuracy value to give the new accuracy value. For instance, Pistols and PDWs have little to no movement penalties, which means when you are running, you accuracy cone is multiplied by roughly 1.1, not increasing the shot cone by much. However, if you begin running with an LMG, your shot cone is multiplied by anywhere from 5 to 10 times, ultimately making your accuracy complete shit. In regards to weapon class balancing, the goal is to make sure the mobile weapons have greater accuracy than those less mobile, but when both players are stationary, the less mobile weapon will be more accurate than the mobile weapon. This has helped us really influence the weapon roles and make sure that CQC weapons dominate in the CQC domain, and long range weapons will outclass CQC weapons over distance. To get a better idea, if two players come around the corner, one wielding an SMG another an Assault Rifle, the SMG player can do circles around the AR player while landing almost every shot, where as if the AR player wants to land shots he is going to need to be fairly stationary thus making him very vulnerable and weak in CQC. However, if you move to an open area, the SMG can spray all they want at the AR player, but few shots will land or do significant damage; whereas the AR player can line up the shot and get the kill. Ultimately, the weapon in 2.0 feel significantly more balanced that previous version of FAS due to the tools I have used, and the approaches I have taken.

Low Level Engineering Summary: Without planning ahead, and approaching the problem initially from the high level, you can really get lost in the numbers. The better you know how a variable works and feels in-game, the faster you will be able to appropriately balance your game. It's also important to know what tools can help you expedite the process of testing and tweaking values, because it can be quite time consuming.

Asymptote of Perfection

The truth of balancing, at least that I have found, is that you will never reach perfect balance, but you can get darn close to what feels right. What you may even notice, is that a weapon may be chosen over another weapon simply due to an aesthetic difference in the view model, or even by it sounding more powerful. These are outside variables that you can't necessarily compensate for, especially because you don't want to purposely unbalance the game just so people use an uncommon weapon, more often. There will always be a human element that will make a player want to grab one weapon over another, but the best you can do is make sure the weapons stay as balanced as possible, because any significant changes can actually be detrimental to game balance once you have reached that asymptote of perfect balance. At some point you have to stop tweaking and just let the players get used to the weapons and have fun.

Thank you for reading my extremely long developer blog, but believe it or not, I am sure I managed to leave out a few things. If there is anything you want me to elaborate on, or have any questions, feel free to ask on any of our communication mediums, and I will do my best to get back to you. If you ask a question that I really like, I may even turn that into another developer blog (hopefully shorter though).

Post comment Comments
Maninblue999
Maninblue999 - - 103 comments

Very, very nice article, who would have thought weapon balancing could be this interesting?

- Consumer

Reply Good karma Bad karma+7 votes
gravetracer
gravetracer - - 39 comments

Seeing how similar the SMGs and Carbines are, and how the carbines have a larger effective range than the SMGs, in addition to much less damage falloff, will SMGs be usefull for anything other than extremely close quarters?

BTW, I loved your article, and if I have time I want to start mod development over the summer.

Reply Good karma Bad karma+1 vote
DysPatch Author
DysPatch - - 101 comments

The mobility modifiers are still different enough to make a difference between carbines and smgs. Additionally, you need to factor in credit cost. Most SMGs will be slightly weaker than the Carbines, but you also get the benefit of a lower cost. SMGs will cost you around 25 credits, where as a carbine will cost you 35 credits. The difference being a sidearm (10 creds), helmet kevlar (10 creds), or arms and legs (5 creds each)kevlar. Theoretically you can go full heavy armor with a carbine, with no credits left over, where as if you did the same with an SMG, you could atleast get a sidearm or explosives. Good question!

Reply Good karma+1 vote
SIGILL
SIGILL - - 1,157 comments

Oh wow this was an interesting read. Although it's about the same approach I had in mind for how I should balance weapons I'm sure I might have picked up some new things here. Thanks for writing this!

Reply Good karma Bad karma+1 vote
DysPatch Author
DysPatch - - 101 comments

No problem. The concepts in the article aren't new by any means. Just showing my approach so that, as you have said, you can pick up a few new things that you may have not thought of. If there are any different approaches you would have taken, I would love to hear them.

Reply Good karma+1 vote
SlayerX3
SlayerX3 - - 2,448 comments

Part 1

Weapons of same caliber and different stats for each.

For example the Sig 550, M4, M16 and G-36K are all 5.56 NATO rifles.

But the Sig 550 and M16 have 20 in. barrels and the M4 and G-36K have 14.5 in. barrels, this directly influences muzzle velocity, thus both "damage" (eg. ballistics) and range.

At point blank range the "damage" from a 5.56 round out of a 14.5 and 20 in. barrel are barely noticeable but after the range of lets say 200m the difference becomes severely noticeable.

The M16 and Sig 550 are on the Assault/Service rifle category while the G-36K and M4 are in the Carbine category

For anyone who ever had to held a long arm in any enclosed space will say that shorter weapons are easier to maneuver than longer weapons. So if you have to turn around with a M4 you'll be able to do it smoothly compared to the M16.

In other works there will be trade offs for each weapon category.

Now for the issue of Carbine vs SMGs

It isn't simple but SMGs are only better then carbines at a few things:

Better ammo carry capacity, usually SMGs have much more compact magazines thus tanking less space of the ammo pouch than a AR/Carbine ammo pouch. For example while you can carry 8 Magazines for a carbine on 4x2 ammo pouches an SMGunner can carry 12 Magazines for 6x2 ammo pouches.

Size and weight, unless it is an WW II era SMG made of steel and woodblocks mostly SMGs are lighter and easier to carry around when compared even to carbines.

Recoil, SMG mostly use pistol cartridges, which have lighter and slower bullets compared to AR/carbines this combined to the SMG heavier frame(compared to pistols of same caliber/pistols in general) and other control features, stock and front grip for example, make sustained automatic fire much more manageable compared to carbines (Ironically AR tend to have lesser recoil when compared to carbines due to the extra weight from the longer barrels).

Reply Good karma Bad karma+2 votes
SlayerX3
SlayerX3 - - 2,448 comments

Part 2

I really appreciate this mod for the weapon balance, it really helps to avoid clusterfucks like you see in CoD:MW where the balance of most weapons seems to be arbitrary for the most of the time. (seriously reducing the barrel length of the weapon does not increase damage, it's the opposite of that actually - I'm looking at you CoD:MW2)

Also I haven't seen nothing about armor penetration values besides damage modifiers for range and armor type, but it would be ridiculous having a Carbine doing sightly similar damage to a heavily armored opponent compared to a SMG at the same range, when intermediary rifle calibers do have much more superior armor penetration than pistol calibers. (5.7mm fits somewhere between an intermediary rifle cartridge and a pistol cartridge)

TL;DR SMGs do have a few advantages over carbines and the later still have some advantages over assault rifles, it's about your style and strategy.

TL;DR2: Great article.

TL;DR3: Please don't make armor penetration/damage values too similar for SMGs and carbines.

Reply Good karma Bad karma+1 vote
DysPatch Author
DysPatch - - 101 comments

I think you pretty much nailed what we were going for. You will see that a lot of the handling you talk about that the SMGs have over Carbines is translated into their mobility modifers. I am glad you enjoyed the article, and at the moment, armor penetration is merely damage absorption factor, which was discussed very briefly when I mentioned the DMR killing in two headshots. Each piece of armor has its own health, and own absorption rate. Heavy armor has higher absorption rates and slightly more health, and the opposite applies for light armor.

Reply Good karma+1 vote
Nt_Carlson
Nt_Carlson - - 2 comments

Wow. Looks like you put a lot of thought into balancing FA:S. This was a very interesting look at mod development. Thanks for taking the time to write this article!

Reply Good karma Bad karma+1 vote
Dr.Goupyl
Dr.Goupyl - - 2,269 comments

Nice work, you on a good way.

Reply Good karma Bad karma+1 vote
TheSniperFan
TheSniperFan - - 376 comments

I'll read through that whole article later, because I have no time atm, but it seems very interesting to me, as somebody that is interesed in how games are made and work.
So, please excuse me if you answered my question in this article.

As you can tell by my Username, I love sniping. I prefer the classical way of sniping (waiting and only pulling the trigger when I'm 120% sure I hit). But there is one thing that simply turns me off most shooters. That Snipers, unless you look through the scone, do literally shoot as if their barrel are shaped like bananas. In many situations I have to rely on my sniper in midrange combat and it simply sucks that they're completely useless then. The point is that it makes no sense, because they're made for being accurate. I'm not talking about .50 cal BMG rifles here, more about rifles like the SVD. It's comparable to the AK, mobility-wise, so why does it behave so unrealisticly*.
*I'm no realism-fanatic, but that is just annoying.

Reply Good karma Bad karma+1 vote
SIGILL
SIGILL - - 1,157 comments

A SVD comparable to an AK? The SVD is twice as long according to wikipedia information. And what do you mean by the barrel shaped like a banana in most shooters? :P That you can't hit a thing at close range? Or the fact that gravity pulls down the bullet? (which doesn't happen in most games as far as I know).

Reply Good karma Bad karma+1 vote
Velancious
Velancious - - 1,978 comments

He's saying in games like in COD the Snipers are made so inaccurate when you don't scope in. It was to balance the game because otherwise I think people would randomly blind fire Snipers at close range and one shot you.

Reply Good karma Bad karma+2 votes
DysPatch Author
DysPatch - - 101 comments

The way I look at it, the benefit of a crosshair is the fact that the gun has "ironsights" that are easily accessible. When you have a large scope like the PSO-1 on a dragunov, you are restricting your ability to aim through the sights and hit targets that are closer in range, those decreasing your accuracy. The accuracy cones in games doesn't have to directly correlate with actually accuracy of the gun, but can simulate real life restriction, like I just described. Yeah, we could find another way to add that restriction, like removing the crosshair, but exploiters can get around that with the simply, tape in the middle of the screen trick. It's up to the game designers to make sure that weapons perform the best in their desired roles. This isn't to say that a sniper can't get CQC kills or mid range kills. It just happens to be more difficult.

Reply Good karma+1 vote
TheSniperFan
TheSniperFan - - 376 comments

I'm talking about hipfire here. But never mind, I will be only unhappy, if snipers are made TOTALLY useless on medium range. It's OK, to tweak them a bit, so they aren't overpowered, just don't make it pure luck to hit something on 15 meters while it was in your crosshair.

Reply Good karma Bad karma+1 vote
MattB1023
MattB1023 - - 90 comments

Prepare for a wall of text:

Finally, a game that ACTUALLY CARES for balance! I thought that balanced and fair game-play was a thing of the past since the Call of Duty explosion/fad.

Also, for the issue of hip-firing snipers, I agree with TheSniperFan. I like sniping, but it feels ridiculous and humiliating when I'm 5 feet from a person and can't shoot him with my sniper. I'm not asking for across-the-map no-scope shots like in Halo, but I still don't want to be completely screwed when I'm flanked or something. If I'm standing perfectly still, I want to be able to shoot a guy within 10 feet or so of me without scoping in. That might not be all that realistic, but games can't be all realism, because they're NOT real life. They're games. Also, not being to hip-fire for **** encourages camping, doesn't it? Why should a sniper move from his/her spot if it means a probable death at mid/close range?

Anyway, great article. I'm glad to know that you guys care about balance.

Reply Good karma Bad karma+1 vote
Schmung
Schmung - - 12 comments

Snipers being crap close in is why there's a credit system. You can rock an MP5 as a backup and spank people at close range as well. If you don't restrict unscoped sniper accuracy at close range then you end up with Quake style railguns and it ruins gameplay utterly.

Reply Good karma Bad karma+2 votes
.:Toast_Pwn:.
.:Toast_Pwn:. - - 12 comments

i..have no idea what this is all about, but im following firearms source so im reading everything lawl :3

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: