Firearms: Source is a team based first person shooter, rooted in the traditions of the Firearms mod for Half-Life. Firearms: Source brings the best aspects of Firearms to the Source engine, and then takes them a step further. You'll see a host of familiar weapons and maps, but you'll find the streamlined game play to be faster, focusing on aggressive, skilled play. From nearly the moment you spawn you can expect to be engaged in furious action.
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 DysPatch on Jun 11th, 2011
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.
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.
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.
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.
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).