Defining mathematical unit balance metrics

Discussion in 'Balance Discussions' started by godde, February 6, 2014.

  1. godde

    godde Well-Known Member

    Messages:
    1,425
    Likes Received:
    499
    I'm in the process of making a database that calculates the unit balance depending on different metrics.

    You can see the progress here: http://people.dsv.su.se/~akbj7812/pa-db/table/everything.html

    Feel free to suggest your own metrics and I might implement them in the database.

    I've only introduced 3 metrics to the original PA-DB so far(thanks to Yarmond for creating PA-DB):
    DPS per metal, which is the same as DPS divided with the metal cost of the unit.(DPS/build_cost)
    HP per metal, which is the same as HP divided with the metal cost of the unit.(HP/build_cost)
    Strength per metal, which is DPS per metal times HP per metal.( (DPS/build_cost) * (HP/build_cost) )

    Strength per metal is a very useful metric as it gives a general idea of how effective the unit is for cost compared to other units.
    I'm not sure what to call this metric. First I intended to call it "Power per metal" but that could confuse it with Power Plants and energy production. An alternative is to call it "Combat efficiency" as it gives an estimate of how a unit performs against other types of units once the units are in range of each other but it disregards things as alpha damage, burst damage, weight and overkill for example.

    Some statistics that I miss are the size of unit footprints, bomber rearming stats(bomber ammo mechanics) and repair rate. If you could tell me where I could extract or find those stats I'd greatly appreciate it.

    Also if you have links to articles that describes different balance metrics or ways to calculate balance metrics in RTS or games in general, feel free to post them.

    I have created the database usings Yarmonds python scripts from https://github.com/speth/planetary-annihilation-db.
    I saved the website with WinHTTrack as it were easier for me to just upload the website rather than running the script on server.
    cola_colin, shootall, drz1 and 2 others like this.
  2. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    It would be interesting to see those metrics included in this mod.
  3. godde

    godde Well-Known Member

    Messages:
    1,425
    Likes Received:
    499
    Yeah, indeed. I plan on making unit by unit comparisons that takes stuff like overkill, burst damage and kiting potential into account as well.
    If you use it ingame it could even display the unit versus unit comparison between the units you have selected and the enemy units under your mouse cursor or in an area.
    R.U.S.E. kind of did this as the strength of your selected units would be compared to the strength of an enemy stack of units under your mouse cursor. It would also estimate how strong your selected units are compared to the stack of enemy units.
  4. ViolentMind

    ViolentMind Active Member

    Messages:
    394
    Likes Received:
    186
    You could call the "Strength per metal" metric, just "General Combat Value", since it's really measuring the value of it's offensive and defensive stats against its cost in metal. A metric that also gave weight to other stats (like range, speed, etc.) and took those into account as well would be "Total Combat Value". Also, I have the same suggestion here as I made with your padb update, which is that you should probably round to some shorter fixed decimal place, like hundredths.
    Last edited: February 6, 2014
  5. BulletMagnet

    BulletMagnet Post Master General

    Messages:
    3,263
    Likes Received:
    591
    Can you calculate the geometric mean of dps, range, and speed?

    I'd like to see how that turns out.
  6. Clopse

    Clopse Post Master General

    Messages:
    2,535
    Likes Received:
    2,865
    When I look at new builds I use a pretty simple formula to start me off to see what may be OP. It takes time:map size, speed, hp, dps, and cost into account. It is nowhere near perfect but works nice for my use.
  7. matizpl

    matizpl Well-Known Member

    Messages:
    229
    Likes Received:
    430
    dps times hp times cost is pretty good in measuring balance in PA right now. Great idea.
  8. Clopse

    Clopse Post Master General

    Messages:
    2,535
    Likes Received:
    2,865
    (DPSxHP)/Cost maybe?
  9. matizpl

    matizpl Well-Known Member

    Messages:
    229
    Likes Received:
    430
    yeah it doesn't matter, I mean those 3 factors are pretty much 80-90% of balance, your suggestion is probably a bit more handy in terms of maths
  10. zaphodx

    zaphodx Post Master General

    Messages:
    2,350
    Likes Received:
    2,409
    This seems really useful. However I would really change it back to strength per metal which accurately describes the value of the number rather than combat value which seems like an arbitrary number.
  11. Arachnis

    Arachnis Well-Known Member

    Messages:
    938
    Likes Received:
    442
    I'm actually a bit sceptical whether balance is something that can be calculated.

    I mean there could be a unit that has 1 hp, 1 dps, but unlimited range fighting against a unit with a million hp, a million dps, but very short range. If both have the same movement speed, the one with unlimited range would win the fight eventually, because of the ability to move it away from the other unit. How do you plan on representing that with calculations based on stats?
    stormingkiwi likes this.
  12. Clopse

    Clopse Post Master General

    Messages:
    2,535
    Likes Received:
    2,865
    Sounds like a boring game. :D. Build 100 of each and the low range high dps will easily win. The ranges of this game however are not so extreme to merit such calculations. They are all within a reasonable enough margin to calculate as 1. Well other than the Sheller.
  13. bobucles

    bobucles Post Master General

    Messages:
    3,388
    Likes Received:
    558
    Oh hey! This thread is only about six months late to the party.

    The most basic formula is that a unit's power is equivalent to its carnage multiplied by its tenacity. Carnage is everything a unit can do to deal damage, while tenacity is every tool it has to stay alive. Power is usually best matched with a unit's cost, with better costs making a unit more common and worse costs hiding it in a niche.

    At its simplest level, carnage is straight DPS while tenacity is pure HP. Everything else builds into these factors such as range, alpha strike, cooldowns, evasion/speed, layer restrictions, synergies, and basically everything that makes an RTS worth playing. Each factor behaves and responds to other factors in a different way, allowing otherwise equal units to be NOT equal on the field.

    Edit: A two resource system not only controls how expensive a unit is, but can modify WHEN it can be fielded. Energy serves a double purpose of also acting like a supply depot, limiting how many of something can be fielded/used. And if you restrict energy to a location, you can determine where those units can be used. Done properly, cost can be much more than a mere statement of raw strength.
    Last edited: February 6, 2014
    stormingkiwi likes this.
  14. godde

    godde Well-Known Member

    Messages:
    1,425
    Likes Received:
    499
    I implemented geometric mean.

    I found this python code snippet:
    Code:
        def geomean(numbers):
            product = 1
            for n in numbers:
                product *= n
            return product ** (1.0/len(numbers))
    http://bytes.com/topic/python/answers/727876-geometrical-mean

    I haven't looked into geometric mean and how it translates into game balance so I'm not sure how useful this statistic is so I am likely to remove it if I don't think it useful.
    BulletMagnet likes this.
  15. websterx01

    websterx01 Post Master General

    Messages:
    1,682
    Likes Received:
    1,063
    Would it be possible to have the speed for static defenses as the rate in which they can turn/ angle? That way the geometric mean of speed, dps and range wouldn't be 0?
  16. godde

    godde Well-Known Member

    Messages:
    1,425
    Likes Received:
    499
    I'm not sure how to weigh stats like range and speed against each other than by a unit versus unit case.
    If you take a simple RPS triangle of Turret, Raider and Artillery. The Turret should be stronger for cost than the Raider while having shorter range than the Artillery. The Raider should be strong enough and fast enough to run down fleeing artillery without dying to it. On an open map, artillery might be too slow to get in and deal damage against enemy turrets without being overrun by faster Raiders. In defense it might be preferable to use turrets supported by raiders that can rush out to kill enemy artillery. On a map with choke points it might be best to turret creep on the enemy supported by artillery to destroy the enemy turrets. Now, how do you weigh these factors into a single "Total Combat Value? I'm not sure you can.

    Determining if a unit can kite another type of unit is easy. If both the speed and the range on the unit is higher, it can potentially kite the other unit forever. I'm thinking about calling this "Kiting potential" or "Outranging potential" but it have to be done on a unit versus unit basis.
    With the correct balance metrics/calculations you can still answer a question like: How many Doxes do you need to chase down and kill a fleeing Leveller?
  17. godde

    godde Well-Known Member

    Messages:
    1,425
    Likes Received:
    499
    Could you show us the formula? Do you base the time:map on the distance between the players?
    Potentially you can use time as a resource instead of metal. The cost of a unit in time is basically variable on your income or infrastructure.
    The time requirement of a unit could be:
    (cost/income)
    If your income is 10 metal, it would take 9 seconds for your economy to generate those resources. The time cost of the Dox could be said to be 9 seconds.
    If your income is 100 metal, it would only take 0.9 seconds for your economy to generate those resources. The time cost of the Dox could be said to be 0.9 seconds.
  18. godde

    godde Well-Known Member

    Messages:
    1,425
    Likes Received:
    499
    Well the basic formula you suggest applies pretty well to Strength per metal ( DPS / cost ) * (HP / cost).
    Yes. I agree. Most balance have to be derived from a unit to unit comparison and in many cases also the situation in which the interaction between the units takes place.

    I'm gonna try to implement Infrastructure values soon. In order to spend metal, you need Infrastructure, power plants and fabbers or factories.
    In order to support a bot factory you need to pay 600 metal for the factory and roughly one supporting T1 Power Plant for a total of 1050 metal. This 1050 metal gives you 12 metal of Bot production(less if you include factory roll-off time).
    The same amount spent in a Vehicle factory with a supporting Power Plant gives you 15 metal of Vehicle production. Vehicles production could be said to require less Infrastructure as you get more build output for the same Infrastructure cost.

    Energy doesn't really restrict how many of something that can be used. It rather raises the Infrastructure cost to use them or produce them.
  19. godde

    godde Well-Known Member

    Messages:
    1,425
    Likes Received:
    499
    Yes, it would be possible. But is the speed at which turrets rotate really proportional to unit speeds? Wouldn't it just be better to give immobile turrets a fixed value?
  20. websterx01

    websterx01 Post Master General

    Messages:
    1,682
    Likes Received:
    1,063
    Probably. I just wasn't too sure about how you wanted to set it up. That would likely work better, or at least more sensibly.
    Last edited: February 7, 2014

Share This Page