An Introduction to Basic Mod Balance
Posted: 26 Sep 2007, 17:46
So you want to balance a mod?
To preempt some of our local gradeschool math failures, yes, you do need experience actually playing the game to do this. Duh.
On the bright side, math actually can help, and here's how.
First, you need to understand resources. In Spring (by default) there are three. If you're lost already, then odds are that you're not destined to be a balancer, and you should probably stick to scripting. =)
Spring's resources by default are those used by Total Annihilation, and subject to certain attributes. Resource income is contributed to an overall "storage pool" that theoretically exists in storage buildings and resource generators, but is all instantly accessible for any purpose, suggesting that it really either exists in some interdimensional transitional state, can be transported instantly by such means, or is simply a convenient RTS convention where common sense takes a back seat to "fun." It should be noted that resources do not have to be this way, and given some elaborate lua scripting, it should be possible to have any number of resources, some or all of which need to be carried to factories or build sites to be spent.
For those of you still here, the three resources in Spring (by default) are Metal, Energy, and SpaceTime, the latter being a combination of time and distance. Effectively, SpaceTime comes down to a relationship between the time to build a unit and the time it takes a given unit to travel from one point on a map to another. Since we're all dumb here, it's easiest to refer only to Build Time versus Worker Time as a resource (Time for short).
Since everything covered so far should fall into the category of "common sense," go ahead and forget about it and we'll get to the math.
In the course of normal observation, it quickly occurs to people playing with unit costs that certain overall archetypes can be applied, and we'll cover several of them in some detail.
Gunship/Ground Ratio
Air doesn't operate under quite the same costing formula that ground does. To begin with, you take all Metal costs for Gunships and divide them by 1.5, and multiply Energy and Build Time costs by 1.5 Don't argue - just du eet! Additionally, when balancing Tired Annihilation I doubly valued Speed, viewing it as both an advantage for reinforcement (and exploiting vulnerabilities), and a factor of range. More about that later, but I didn't calculate aircraft speed as a factor of range, given that air speeds and movement classes generally negate range to begin with.
Air/Ground Ratio
For all air other than Gunships (traditionally Bladewings, Banshees, Rapiers, Brawlers, Blades, Blackdawns and Krows), you divide Metal costs by 2 and multiple Energy and Build Time costs by 2. This includes Bombers, Fighters, Builders, etc.
Weapon Cost x for Air Only.
You don't have to do this, but it occured to me that TA (Tired Annihilation) anti-air weapon costs were unreasonable, given that they could not shoot ground as well (eliminating MT forests). As such, I divided all Weapon Values (defined as dps*Range*Speed*Rounded AoE) that were strictly anti-air by 3. The important note in this case is consistency - if you discount some weapons that only shoot air, then discount all weapons that only shoot air.
Conversion Ratios
In TA, I decided that the simplest costing method was a flat scale. If a unit costs so much Metal, then it will cost so much Energy and Build Time as well. I determined the specific amounts using a baseline unit, but we'll cover that later. The specific ratios that I established were: 1 Metal = 60 Energy (determined by the E/M conversion rates of metal makers, which I standardized), 1 Metal = 17.14 Time (Build Time or Worker Time), and by comparing the two, 1 Time = 3.5 Energy. Given this relationship, the three costs can be used interchangeably - if you want a unit to cost 10 less Metal, then increase its Energy cost by 600 or its Time cost by 171.4. Just make sure that you never increase one or more without decreasing another, and at this fixed rate.
Rates that you use can be whatever you like - I used a baseline unit (a theoretical unit that I pulled out of a hat and labelled "properly costed" to have default values for how much things should cost for given abilities), but you can use whatever feels appropriate. If you want, decrease the Metal/Time Ratio to something like 14. Effectively, it will cost more metal relatively to make a unit build faster, although you would save more metal by building more slowly. Also, you could adjust your baseline costs to have a higher relative Build Time to Metal ratio going in.
I'm skipping steps in here somewhere, but I haven't slept in awhile - probably come back to edit this section. ~~
Combat Duration
I used 13.5. That is to say, a fight between two nameless, average units will take 13.5 seconds. This is important for a number of reasons. First of all, it gives you an idea as to how dps and Health should relate. An average unit shooting another average unit should take roughly 13.5 seconds to kill it. In reality, unit specialties create a more dramatic range: Bulldogs, for example, with 4,200 health and 235 dps would take 17.9 seconds to kill each other, and Flash Tanks, with 600 health and 106.5 dps would take 5.6 seconds. Fractions matter. More on how unit specialties are defined later.
13.5 seconds also, coincidentally (or not so), is how long it takes an average bomber to complete its reload and pathing cycles after dropping a load to come around and drop another (the assumption being that most bombers won't survive to drop two loads). As such, all bomber dps can be divided by 13.5. Additionally, stunner weapons, for reasons too bizarre to contemplate, can also be divided by 13.5, as they generally remove a unit from a melee, "killing" it for the purposes of a single battle. As such, a Stilleto bomber's EMP dps is divided by 13.5 twice - once for being dropped from a bomber, and once for being an EMP weapon. (Don't worry - the BA Stilleto's weapon is still hideously underpriced.)
Because of the way that OTA-based mod bombing scripts run, this 13.5 second combat duration is more or less inviolate (added to the fact that OTA, and resultantly the better parts of its mods, were based around this core concept going in). If you don't want to base your mod off of TA, or want radically change the way that an OTA-based mod tends to operate, then feel free to try out other values and make adjustments accordingly.
Comparing Units - Costing in a Can
Earlier, when I mentioned a baseline unit, I was refering to an imaginary unit that I compared all others against to gain a relative cost for relative effectiveness. Tired Annihilation as a whole is based on relative values - the overall value of firepower is dependent on a unit's health, Line of Sight, etc. - as opposed to absolute values - +20 dps = +5 Metal, +300 Energy, +85.7 more Build Time. As such, increasing dps by 20 might cost +5 metal more or +50, dependent on the unit's other attributes.
Core Unit Attributes
Really, that's all of them, but I don't have the kind of time needed to deal with all of that crap, so I generalized some and prayed that OTA/AA/BA had left me reasonable slope tolerances, turning rates, E costs for cloaking, etc. In some cases, they didn't, and here I broke with math to a degree to make changes that "felt" right to make a unit fulfill its desired function. Yes, this wasn't the best approach - it was the lazy approach that worked, and AA/BA and even OTA have a long and respectable enough history of that.
What I did do was take rarified attributes and assign them a base (arbitrary) value. +20% to costs for cloaking, Kbot movement class, Flight, hovering, stealth, amphibiousness, etc. I started to assign arbitrary values for unit "class" (based upon function) too, but realized that to be happy with the results I'd have to break down and mathematicize all of the lesser constituent attributes. Even footprint size can be a relative attribute, as larger size messes with pathing, but also decreases the effects of AoE on units that stupidly cluster together while pathing (although these two effects to a degree cancel each other out).
Screw that. Someone else feel free to improve upon me.
What I did create percentages for to apply to overall Unit Value were: Speed, Health, Weapon Value (Speed*dps*Range*Rounded AoE for ground, dps*Range*Rounded AoE for air and statics), and Line of Sight for combat units, Radar Area, Jamming Area, Sonar Area, and Worker Time for non-combat units. To establish a baseline cost for these values, select a value that seems reasonable, and compare the units with said attribute to that baseline for a percentage. If you want to get fancy, use Pi*R^2 to determine areas for radar, jamming, and sonar, and divide the results for a unit by the baseline. I didn't, but probably should've.
The important part remains consistency. Once you have your formulas in place, when you find a part in need of changing, then change the formula itself to better reflect the realities of a situation instead of a given unit affected by it at a time (even though this is tempting, as changing the formula will mean changing every single unit it touches).
Putting it all Together
So here's a sample baseline for a combat unit (happens to be the one I used in TA).
Metal Cost: 150
Energy Cost: 1,200
Build Time: 2,227.5
Speed: 1.5
Health: 1,000
Weapon Value (Speed*dps*Range*Rounded AoE): 56,430
Line of Sight: 380
Special Abilities: Kbot (+20% to Costs)
Now we'll cost a Krow.
Speed: 3.83
(3.83+1)/(1.5+1) = 1.932 The +1 is added to account for statics, which have no speed, and for sub-one speed units, which would end up being stronger than statics if speed was simply removed as a factor for statics altogether.
Health: 7,200
7,200/1,000 = 7.2 (Whee! It's easy!^^)
Weapon Value: (Don't count Speed, as it's an aircraft)*130.8 dps*525 Range*1.00 Rounded AoE = 68,670 for a KROWLASER2. There are two of these. 138.5 dps*575 Range*1.00 Rounded AoE = 79,637.5 for a KROWLASER. Next, sum the weapon values. 68,670*2+79,637.5 = 216,977.5/56,430 = 4.039
Line of Sight: 710/380 = 1.87
Special Abilities: Flight (+20% to costs - no higher than Kbot movement class costs, but remember that aircraft follow special costing rules.)
Now apply the results to your selected formula. Mine was:
Speed%*((Weapon Value% + Health%)/2)*LoS%*Special Value%
1.932*((7.2+4.039)/2)*1.87*1 (Special Ability costs counter each other out here) = 20.302
This gives us:
Metal Cost: 2,030 (150*20.302/1.5 [it's a Gunship, remember])
Energy Cost: 36,544 (1,200*20.302*1.5)
Build Time: 67,834 (2,227.5*20.302*1.5)
Now, some might argue that I've undervalued health or overvalued Speed or Line of Sight. I would respond that they might be right, and that they should feel free to offer an improved formula, as this one was cranked out in about two minutes. The application of experience and a modicrum of rationality are the counterweight to any such possibilities. Make sure units pass the common sense test.
This costing method is a helper more than a definitive system, but only because I've neither the time nor the math skills at hand to make it perfect. More complex relationships are easy to postulate and difficult to realize, but if people are willing to waste years on unpopular mods, then such a quixotic quest might seem appealing. If you're up for it, then go for it. If not, then this application of the system still works well.
More on unit roles as determined by stats when I'm bored again.
To preempt some of our local gradeschool math failures, yes, you do need experience actually playing the game to do this. Duh.
On the bright side, math actually can help, and here's how.
First, you need to understand resources. In Spring (by default) there are three. If you're lost already, then odds are that you're not destined to be a balancer, and you should probably stick to scripting. =)
Spring's resources by default are those used by Total Annihilation, and subject to certain attributes. Resource income is contributed to an overall "storage pool" that theoretically exists in storage buildings and resource generators, but is all instantly accessible for any purpose, suggesting that it really either exists in some interdimensional transitional state, can be transported instantly by such means, or is simply a convenient RTS convention where common sense takes a back seat to "fun." It should be noted that resources do not have to be this way, and given some elaborate lua scripting, it should be possible to have any number of resources, some or all of which need to be carried to factories or build sites to be spent.
For those of you still here, the three resources in Spring (by default) are Metal, Energy, and SpaceTime, the latter being a combination of time and distance. Effectively, SpaceTime comes down to a relationship between the time to build a unit and the time it takes a given unit to travel from one point on a map to another. Since we're all dumb here, it's easiest to refer only to Build Time versus Worker Time as a resource (Time for short).
Since everything covered so far should fall into the category of "common sense," go ahead and forget about it and we'll get to the math.
In the course of normal observation, it quickly occurs to people playing with unit costs that certain overall archetypes can be applied, and we'll cover several of them in some detail.
Gunship/Ground Ratio
Air doesn't operate under quite the same costing formula that ground does. To begin with, you take all Metal costs for Gunships and divide them by 1.5, and multiply Energy and Build Time costs by 1.5 Don't argue - just du eet! Additionally, when balancing Tired Annihilation I doubly valued Speed, viewing it as both an advantage for reinforcement (and exploiting vulnerabilities), and a factor of range. More about that later, but I didn't calculate aircraft speed as a factor of range, given that air speeds and movement classes generally negate range to begin with.
Air/Ground Ratio
For all air other than Gunships (traditionally Bladewings, Banshees, Rapiers, Brawlers, Blades, Blackdawns and Krows), you divide Metal costs by 2 and multiple Energy and Build Time costs by 2. This includes Bombers, Fighters, Builders, etc.
Weapon Cost x for Air Only.
You don't have to do this, but it occured to me that TA (Tired Annihilation) anti-air weapon costs were unreasonable, given that they could not shoot ground as well (eliminating MT forests). As such, I divided all Weapon Values (defined as dps*Range*Speed*Rounded AoE) that were strictly anti-air by 3. The important note in this case is consistency - if you discount some weapons that only shoot air, then discount all weapons that only shoot air.
Conversion Ratios
In TA, I decided that the simplest costing method was a flat scale. If a unit costs so much Metal, then it will cost so much Energy and Build Time as well. I determined the specific amounts using a baseline unit, but we'll cover that later. The specific ratios that I established were: 1 Metal = 60 Energy (determined by the E/M conversion rates of metal makers, which I standardized), 1 Metal = 17.14 Time (Build Time or Worker Time), and by comparing the two, 1 Time = 3.5 Energy. Given this relationship, the three costs can be used interchangeably - if you want a unit to cost 10 less Metal, then increase its Energy cost by 600 or its Time cost by 171.4. Just make sure that you never increase one or more without decreasing another, and at this fixed rate.
Rates that you use can be whatever you like - I used a baseline unit (a theoretical unit that I pulled out of a hat and labelled "properly costed" to have default values for how much things should cost for given abilities), but you can use whatever feels appropriate. If you want, decrease the Metal/Time Ratio to something like 14. Effectively, it will cost more metal relatively to make a unit build faster, although you would save more metal by building more slowly. Also, you could adjust your baseline costs to have a higher relative Build Time to Metal ratio going in.
I'm skipping steps in here somewhere, but I haven't slept in awhile - probably come back to edit this section. ~~
Combat Duration
I used 13.5. That is to say, a fight between two nameless, average units will take 13.5 seconds. This is important for a number of reasons. First of all, it gives you an idea as to how dps and Health should relate. An average unit shooting another average unit should take roughly 13.5 seconds to kill it. In reality, unit specialties create a more dramatic range: Bulldogs, for example, with 4,200 health and 235 dps would take 17.9 seconds to kill each other, and Flash Tanks, with 600 health and 106.5 dps would take 5.6 seconds. Fractions matter. More on how unit specialties are defined later.
13.5 seconds also, coincidentally (or not so), is how long it takes an average bomber to complete its reload and pathing cycles after dropping a load to come around and drop another (the assumption being that most bombers won't survive to drop two loads). As such, all bomber dps can be divided by 13.5. Additionally, stunner weapons, for reasons too bizarre to contemplate, can also be divided by 13.5, as they generally remove a unit from a melee, "killing" it for the purposes of a single battle. As such, a Stilleto bomber's EMP dps is divided by 13.5 twice - once for being dropped from a bomber, and once for being an EMP weapon. (Don't worry - the BA Stilleto's weapon is still hideously underpriced.)
Because of the way that OTA-based mod bombing scripts run, this 13.5 second combat duration is more or less inviolate (added to the fact that OTA, and resultantly the better parts of its mods, were based around this core concept going in). If you don't want to base your mod off of TA, or want radically change the way that an OTA-based mod tends to operate, then feel free to try out other values and make adjustments accordingly.
Comparing Units - Costing in a Can
Earlier, when I mentioned a baseline unit, I was refering to an imaginary unit that I compared all others against to gain a relative cost for relative effectiveness. Tired Annihilation as a whole is based on relative values - the overall value of firepower is dependent on a unit's health, Line of Sight, etc. - as opposed to absolute values - +20 dps = +5 Metal, +300 Energy, +85.7 more Build Time. As such, increasing dps by 20 might cost +5 metal more or +50, dependent on the unit's other attributes.
Core Unit Attributes
Really, that's all of them, but I don't have the kind of time needed to deal with all of that crap, so I generalized some and prayed that OTA/AA/BA had left me reasonable slope tolerances, turning rates, E costs for cloaking, etc. In some cases, they didn't, and here I broke with math to a degree to make changes that "felt" right to make a unit fulfill its desired function. Yes, this wasn't the best approach - it was the lazy approach that worked, and AA/BA and even OTA have a long and respectable enough history of that.
What I did do was take rarified attributes and assign them a base (arbitrary) value. +20% to costs for cloaking, Kbot movement class, Flight, hovering, stealth, amphibiousness, etc. I started to assign arbitrary values for unit "class" (based upon function) too, but realized that to be happy with the results I'd have to break down and mathematicize all of the lesser constituent attributes. Even footprint size can be a relative attribute, as larger size messes with pathing, but also decreases the effects of AoE on units that stupidly cluster together while pathing (although these two effects to a degree cancel each other out).
Screw that. Someone else feel free to improve upon me.
What I did create percentages for to apply to overall Unit Value were: Speed, Health, Weapon Value (Speed*dps*Range*Rounded AoE for ground, dps*Range*Rounded AoE for air and statics), and Line of Sight for combat units, Radar Area, Jamming Area, Sonar Area, and Worker Time for non-combat units. To establish a baseline cost for these values, select a value that seems reasonable, and compare the units with said attribute to that baseline for a percentage. If you want to get fancy, use Pi*R^2 to determine areas for radar, jamming, and sonar, and divide the results for a unit by the baseline. I didn't, but probably should've.
The important part remains consistency. Once you have your formulas in place, when you find a part in need of changing, then change the formula itself to better reflect the realities of a situation instead of a given unit affected by it at a time (even though this is tempting, as changing the formula will mean changing every single unit it touches).
Putting it all Together
So here's a sample baseline for a combat unit (happens to be the one I used in TA).
Metal Cost: 150
Energy Cost: 1,200
Build Time: 2,227.5
Speed: 1.5
Health: 1,000
Weapon Value (Speed*dps*Range*Rounded AoE): 56,430
Line of Sight: 380
Special Abilities: Kbot (+20% to Costs)
Now we'll cost a Krow.
Speed: 3.83
(3.83+1)/(1.5+1) = 1.932 The +1 is added to account for statics, which have no speed, and for sub-one speed units, which would end up being stronger than statics if speed was simply removed as a factor for statics altogether.
Health: 7,200
7,200/1,000 = 7.2 (Whee! It's easy!^^)
Weapon Value: (Don't count Speed, as it's an aircraft)*130.8 dps*525 Range*1.00 Rounded AoE = 68,670 for a KROWLASER2. There are two of these. 138.5 dps*575 Range*1.00 Rounded AoE = 79,637.5 for a KROWLASER. Next, sum the weapon values. 68,670*2+79,637.5 = 216,977.5/56,430 = 4.039
Line of Sight: 710/380 = 1.87
Special Abilities: Flight (+20% to costs - no higher than Kbot movement class costs, but remember that aircraft follow special costing rules.)
Now apply the results to your selected formula. Mine was:
Speed%*((Weapon Value% + Health%)/2)*LoS%*Special Value%
1.932*((7.2+4.039)/2)*1.87*1 (Special Ability costs counter each other out here) = 20.302
This gives us:
Metal Cost: 2,030 (150*20.302/1.5 [it's a Gunship, remember])
Energy Cost: 36,544 (1,200*20.302*1.5)
Build Time: 67,834 (2,227.5*20.302*1.5)
Now, some might argue that I've undervalued health or overvalued Speed or Line of Sight. I would respond that they might be right, and that they should feel free to offer an improved formula, as this one was cranked out in about two minutes. The application of experience and a modicrum of rationality are the counterweight to any such possibilities. Make sure units pass the common sense test.
This costing method is a helper more than a definitive system, but only because I've neither the time nor the math skills at hand to make it perfect. More complex relationships are easy to postulate and difficult to realize, but if people are willing to waste years on unpopular mods, then such a quixotic quest might seem appealing. If you're up for it, then go for it. If not, then this application of the system still works well.
More on unit roles as determined by stats when I'm bored again.