Author Topic: "Utility" function for balance goals  (Read 1742 times)

Offline TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,552
"Utility" function for balance goals
« on: March 20, 2012, 08:05:29 PM »
In an earlier post, there was a list of goals for "utility ratios" for each ship cap. However, utility is a very difficult thing to nail down numerically.

The purpose of this post is to see if we can provide formula giving a very rough estimation of utility for military ships.

So, here is the framework I can think of off the top of my head.

Warning, math ahead.

for any military unit type s,

overall_utility(s) = (defensive_utility_weight * defensive_utility(s) + offensive_utility_weight * offensive_utility(s) + mobility_utility_weight * mobility_utility(s) - (economic_penalty_weight * economic_cost(s))) * rarity_multiplier(s)

Hopefully, most of the constant and function names should be obvious.
The only thing I can think of that would require explaination is the rarity_multiplier.
Basically, its a multiplier based on how likely a player will get their hands on that ship type in a random game, with always available ships having the max value, and bonus ships having max value / 1.3 (per Keith's balance reference
Basically, ships that are less likely to be seen and/or harder to get your hands on better be more useful in return.

I'm not going into exact formulas for each of the "sub-functions", but my ideas for them are

defensive_utility: Scales multiplicatively with ship cap and defensive attributes, and linearly with HP and armor (though armor would be divided by some value to make it "less" of a factor, representing that armor doesn't usually help durability as much as more HP does).
Notice that speed is NOT in this category.
Defensive attributes are special properties of the ship that can impact defensive viability, like cloaking, radar dampening, sniper immunity, takes extra damage on enemy planets, etc. Each attribute would have a different value associated with it, representing how much that attribute aids or detracts from defensive utility.

offensive_utility: Scales multiplicatively with ship cap and offensive attributes, and linearly with a weighted average DPS.
The weighted average DPS would be composed of three factors, average DPS (DPS averaged over their hull bonuses over the summed ship cap of all units with that hull bonus (special measures taken for ships with infinite caps)), non-bonus DPS, and max-bonus DPS (their DPS against their best hull bonus). Each one of these would be weighted differently based on how relevant each measure of DPS is to actual viability. Presumably, average DPS would have the highest weight, and max-bonus DPS having the lowest.
Notice, speed and range are NOT in this category.
Offensive attributes are special properties of the ship that can impact offensive viability, like forcefield immunity, armor piercing, radar dampening immunity, etc. Each attribute would have a different value associated with it, representing how much that attribute aids or detracts from offensive utility.

mobility_utility: would scale multiplicatively with mobility attributes, and logarithmically with speed and weapon range.
I'm really sure if speed should be linear instead, range should be linear, or both. The idea behind the logarithmically idea is that beyond some value, extra speed or extra range doesn't add that much more to a unit.
Note, ship cap does NOT factor into this. How much range and speed helps a ship is largely independent of how many of those ships there are. If needed though, some smallish ratio of ship cap scaling can be added in
Mobility attributes are special properties of the ship that can impact mobility, like gravity immunity, tractor beam immunity, speed boost immunity, etc. Each attribute would have a different value associated with it, representing how much that attribute aids or detracts from mobility utility.

economic_cost: Consists of two parts. The first part scale multiplicatively with ship cap and linearly with mineral, and crystal, and energy costs and logarithmically with build time. The second part would scale linearly with a weighted sum of given knowledge cost (how much knowledge to unlock that ship itself) and effective knowledge cost (how much to unlock the ship itself and all prerequisite unlocks). Sum the two parts together to get this cost


Notice that there are a LOT of constants to be determined. Rough guesses will do, as this is mostly to give a "baseline" utility.

Also, this model poorly handles non-military ships or ships with a VERY wacky attributes (like decoys, Zenith viral shredders, Spire gravity wells, regenerator golems).
But hopefully this will help point out ships that are an order of magnitude more or less useful than their balance goal.
« Last Edit: March 20, 2012, 08:48:20 PM by techsy730 »

Offline zharmad

  • Hero Member Mark III
  • *****
  • Posts: 1,074
Re: "Utility" function for balance goals
« Reply #1 on: March 20, 2012, 09:23:51 PM »
On the topic of something broadly similar, I was making some a graphical illustration of of fleet-type niche for the wiki. Made an approximate comparison function that takes a logarithm of most of the values to get the total fleet-ship range approximately between 0 and 10 with an average of about 5 depending on the nature of the distribution.

The attachment was what I was trying to get at.

EdiT: Slightly updated values for the Radar graph, and uploaded the equivalent version of the xlsx.
« Last Edit: March 20, 2012, 09:49:24 PM by zharmad »

Offline Wanderer

  • Master Member Mark II
  • *****
  • Posts: 1,577
  • If you're not drunk you're doing it wrong.
Re: "Utility" function for balance goals
« Reply #2 on: March 20, 2012, 09:35:59 PM »
On the topic of something broadly similar, I was making some a graphical illustration of of fleet-type niche for the wiki. Made an approximate comparison function that takes a logarithm of most of the values to get the total fleet-ship range approximately between 0 and 10 with an average of about 5 depending on the nature of the distribution.

The attachment was what I was trying to get at.

There is no blinkin' way that Fighters have equivalent cap-health.  Take your flight of MK Is into a system.  Have a few battles.  Retreat your 3/4 cap of Missile Frigs and 1/2 cap of Bombers and go pick up all your lost fighters back at the home system.

I don't care what your logical math says, my play time says they are cannon fodder.   :P
... and then we'll have cake.

Offline Orelius

  • Sr. Member
  • ****
  • Posts: 328
Re: "Utility" function for balance goals
« Reply #3 on: March 20, 2012, 09:41:44 PM »
Well, the fighters are always the first ones into the fray because of their lower range.  Also, when they die, they tend to die en masse due to anti-fighter ships or structures such as MLRS guard posts or flak guardians.

Having a little chart like zharmad suggested is probably exactly the thing that is needed to be able to judge ship strengths and weakness on the fly.  It's far too much of a pain to do so otherwise.

Offline zharmad

  • Hero Member Mark III
  • *****
  • Posts: 1,074
Re: "Utility" function for balance goals
« Reply #4 on: March 20, 2012, 09:56:06 PM »
On the topic of something broadly similar, I was making some a graphical illustration of of fleet-type niche for the wiki. Made an approximate comparison function that takes a logarithm of most of the values to get the total fleet-ship range approximately between 0 and 10 with an average of about 5 depending on the nature of the distribution.

The attachment was what I was trying to get at.

There is no blinkin' way that Fighters have equivalent cap-health.  Take your flight of MK Is into a system.  Have a few battles.  Retreat your 3/4 cap of Missile Frigs and 1/2 cap of Bombers and go pick up all your lost fighters back at the home system.

I don't care what your logical math says, my play time says they are cannon fodder.   :P

Since we're not factoring in target priorities, armor rating, speed (rate at which ship suicides into the enemy of course :D), and abundance of hull bonuses - the overall survival utility function will look very different on the other side. ;)

The point is, Cannon-fodders will usually take a certain shape on the graph with average/high speed, low energy and resource use, low range and low armour. Cap-health variations are fairly small across fleet-ships, isn't a determinant.

  = = =
Edit: The Hull-bonuses will probably need to be sub-divided into anti-heavy and anti-light, in the future, since Missile Frigates and Bombers analogues can have similar shapes.
« Last Edit: March 20, 2012, 10:38:41 PM by zharmad »

Offline Bognor

  • Hero Member
  • *****
  • Posts: 570
Re: "Utility" function for balance goals
« Reply #5 on: March 21, 2012, 08:48:05 AM »
Some random thoughts, at the risk of overcomplicating things:

offensive_utility: Scales multiplicatively with ship cap and offensive attributes, and linearly with a weighted average DPS.
The weighted average DPS would be composed of three factors, average DPS (DPS averaged over their hull bonuses over the summed ship cap of all units with that hull bonus (special measures taken for ships with infinite caps)), non-bonus DPS, and max-bonus DPS (their DPS against their best hull bonus). Each one of these would be weighted differently based on how relevant each measure of DPS is to actual viability. Presumably, average DPS would have the highest weight, and max-bonus DPS having the lowest.
I guess the relative weights of non-bonus DPS and max-bonus DPS should depend on the range and speed of the ship.  It's pretty easy for a sniper to hit something that's any one of Light, Medium, CloseCombat, or Polycrystal, whereas a slow-moving, short-range ship like an armor ship will often end up applying its non-bonus DPS.

defensive_utility: Scales multiplicatively with ship cap and defensive attributes, and linearly with HP and armor (though armor would be divided by some value to make it "less" of a factor, representing that armor doesn't usually help durability as much as more HP does).
I guess hull type should fit in there somewhere.  A ship with a composite hull is far less vulnerable than one with, say, light.

overall_utility(s) = (defensive_utility_weight * defensive_utility(s) + offensive_utility_weight * offensive_utility(s) + mobility_utility_weight * mobility_utility(s) - (economic_penalty_weight * economic_cost(s))) * rarity_multiplier(s)
Perhaps the formula would be more intuitive if the rarity multiplier were omitted?  To me, "overall_utility" should mean exactly that, and the target number for a cap of bonus fleet ships should be about 30% higher than for a cap of triangle ships, for example.
« Last Edit: March 21, 2012, 08:50:19 AM by Bognor »
Your computer can help defeat malaria!
Please visit the World Community Grid to find out how.

Offline TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,552
Re: "Utility" function for balance goals
« Reply #6 on: March 21, 2012, 09:37:02 AM »
Some random thoughts, at the risk of overcomplicating things:

offensive_utility: Scales multiplicatively with ship cap and offensive attributes, and linearly with a weighted average DPS.
The weighted average DPS would be composed of three factors, average DPS (DPS averaged over their hull bonuses over the summed ship cap of all units with that hull bonus (special measures taken for ships with infinite caps)), non-bonus DPS, and max-bonus DPS (their DPS against their best hull bonus). Each one of these would be weighted differently based on how relevant each measure of DPS is to actual viability. Presumably, average DPS would have the highest weight, and max-bonus DPS having the lowest.
I guess the relative weights of non-bonus DPS and max-bonus DPS should depend on the range and speed of the ship.  It's pretty easy for a sniper to hit something that's any one of Light, Medium, CloseCombat, or Polycrystal, whereas a slow-moving, short-range ship like an armor ship will often end up applying its non-bonus DPS.

Good point. If we are trying to nail down an exact multiplier, then dynamic weighting would be a good idea. However, for a first iteration, I think constant multipliers would do.

defensive_utility: Scales multiplicatively with ship cap and defensive attributes, and linearly with HP and armor (though armor would be divided by some value to make it "less" of a factor, representing that armor doesn't usually help durability as much as more HP does).
I guess hull type should fit in there somewhere.  A ship with a composite hull is far less vulnerable than one with, say, light.

Oops, forgot that. Maybe add in another term somewhere representing "average vulnerability" using a similar calculation for average DPS, except measuring over "multiplier against my hull type"

overall_utility(s) = (defensive_utility_weight * defensive_utility(s) + offensive_utility_weight * offensive_utility(s) + mobility_utility_weight * mobility_utility(s) - (economic_penalty_weight * economic_cost(s))) * rarity_multiplier(s)
Perhaps the formula would be more intuitive if the rarity multiplier were omitted?  To me, "overall_utility" should mean exactly that, and the target number for a cap of bonus fleet ships should be about 30% higher than for a cap of triangle ships, for example.

Also a very good point. I guess ignore the rarity part for this calculation, and factor that in the "balance goals" instead.

So, the revised overall function becomes
overall_utility(s) = defensive_utility_weight * defensive_utility(s) + offensive_utility_weight * offensive_utility(s) + mobility_utility_weight * mobility_utility(s) - (economic_penalty_weight * economic_cost(s))

Anyone have any opinions on the overall relative value of offense, defense, mobility, and "cheapness" in this game, given how the mechanics work currently?

Offline Diazo

  • Master Member Mark II
  • *****
  • Posts: 1,710
  • I love/hate Diff 10
Re: "Utility" function for balance goals
« Reply #7 on: March 21, 2012, 11:29:56 AM »
Anyone have any opinions on the overall relative value of offense, defense, mobility, and "cheapness" in this game, given how the mechanics work currently?

I took a stab at this and came up with a total blank. There are just too many options.

Did you draw a Pacifist AI type? Starships are almost useless. (Pacifist being the one with Orbital Mass Drivers and Warhead Interceptors everywhere.)

Did you draw a Cloaker AI type? Deep raiders to kill the planetary cloaks just became a lot more useful.

What about Space Planes? Their cloak and radar dampening makes them excellent raiders but as my only bonus ship so far (in my current game) I need them to keep their combat power intact so I can put them on the firing line when I need all the combat power I can get. I am afraid something like this would lower the Space Planes combat power in the name of balance because its 'utility' power is so high.

Doing a game wide re-balancing is something that is probably needed with all the incremental tweaks that have been going on, but I feel something like this is too rigid and risks ending up with a handful of great ships and all the others feeling useless in comparison.

D.

Offline TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,552
Re: "Utility" function for balance goals
« Reply #8 on: March 21, 2012, 11:43:14 AM »
Anyone have any opinions on the overall relative value of offense, defense, mobility, and "cheapness" in this game, given how the mechanics work currently?

I took a stab at this and came up with a total blank. There are just too many options.

Did you draw a Pacifist AI type? Starships are almost useless. (Pacifist being the one with Orbital Mass Drivers and Warhead Interceptors everywhere.)

Did you draw a Cloaker AI type? Deep raiders to kill the planetary cloaks just became a lot more useful.

What about Space Planes? Their cloak and radar dampening makes them excellent raiders but as my only bonus ship so far (in my current game) I need them to keep their combat power intact so I can put them on the firing line when I need all the combat power I can get. I am afraid something like this would lower the Space Planes combat power in the name of balance because its 'utility' power is so high.

Doing a game wide re-balancing is something that is probably needed with all the incremental tweaks that have been going on, but I feel something like this is too rigid and risks ending up with a handful of great ships and all the others feeling useless in comparison.

D.

As I mentioned, this type of approach WILL mess up on odd ships, odd oponents, and will overestimate and underestimate certain ships.

The result of this formula is a rough baseline. Exact comparisons are not important. What we want to get right in most cases is the order of magnitude.

If a ship type, after running through this formula, turns out to be an order of magnitude or two above or below the other ships of its "tier", then maybe we should look at it.
It may be that the formula is wrong, and that it is fine as is. This is not to serve as a true balancing measure, but rather a way to flag potential "outliers"

So, maybe I should amend my formula's name to

very_rough_approximation_of_overall_utility(s) = defensive_utility_weight * defensive_utility(s) + offensive_utility_weight * offensive_utility(s) + mobility_utility_weight * mobility_utility(s) - (economic_penalty_weight * economic_cost(s))

Offline Diazo

  • Master Member Mark II
  • *****
  • Posts: 1,710
  • I love/hate Diff 10
Re: "Utility" function for balance goals
« Reply #9 on: March 21, 2012, 11:50:51 AM »
So, maybe I should amend my formula's name to

very_rough_approximation_of_overall_utility(s) = defensive_utility_weight * defensive_utility(s) + offensive_utility_weight * offensive_utility(s) + mobility_utility_weight * mobility_utility(s) - (economic_penalty_weight * economic_cost(s))

Seeing this formula, I think my objection boils down to "How I define Utility is different from how you define Utility which is different from how he defines Utility."

Again, I'm not sure what to say. I see the need for a rebalance but my gut feeling is that flat out assigning numbers is too simplistic for how varied the game is.

Having said that, I don't have another option to offer in exchange so a numbers formula is probably the place to start but expect there to be a lot of outliers, even after the rebalance is done?

D.

Offline keith.lamothe

  • Arcen Games Staff
  • Administrator
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,504
Re: "Utility" function for balance goals
« Reply #10 on: March 21, 2012, 11:57:55 AM »
In general I'm not looking for an overall formula for balance.  In some kinds of games it would be possible or even helpful, but here there's just too many variables for it to be an efficient way to improve the fun of the game.

Instead I try to:
1) Find meaningful apples-and-apples metrics for comparing ship-types in a meaningful way in specific senses.  Cap-health, base cap-dps, max cap-dps, cap-m+c, cap-e, etc. 
2) Then I try to find acceptable ranges for those, like fleet ship cap-health should be between 5M and 30M, and starship cap-health should be between 7.5M and 45M.  And fleet ship max-cap-dps can be 100k-120k with no bonuses (so it's equal to base-cap-dps), or up to 300k-400k with bonuses if the base-cap-bonus is in the 30k-40k range.  And 2/3rds of those numbers for starships.  And fleet-ship cap-m+c can range from about 4000 ((10m+10c)*198) to slightly north of the Bomber's cost.  And so on
3) Then, looking at a unit as a whole and considering less quantifiable things (has-cloaking, does-reclamation-damage, etc), and try to pick values in each of those ranges such that it is useful but not overpowered.
4) See how much hate it gets, and in which direction, and make adjustments if necessary ;)

Longer term, it has become apparent that the ranges I've been using are probably in need of revision; 5M is probably too low a cap-health for a fleet ship.  The ranges I used for armor seem to be just too low to be significant.  And something with even 150k base-dps with no bonuses doesn't seem to really compare (in popularity at least) with something that has, say, 60k base and 250k max.  But adjustments can be made, and I think it will continue to move towards more fun (which is the point; balance itself isn't the point, it just helps remove impediments to fun).
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,552
Re: "Utility" function for balance goals
« Reply #11 on: March 21, 2012, 12:47:29 PM »
In general I'm not looking for an overall formula for balance.  In some kinds of games it would be possible or even helpful, but here there's just too many variables for it to be an efficient way to improve the fun of the game.

Instead I try to:
1) Find meaningful apples-and-apples metrics for comparing ship-types in a meaningful way in specific senses.  Cap-health, base cap-dps, max cap-dps, cap-m+c, cap-e, etc. 
2) Then I try to find acceptable ranges for those, like fleet ship cap-health should be between 5M and 30M, and starship cap-health should be between 7.5M and 45M.  And fleet ship max-cap-dps can be 100k-120k with no bonuses (so it's equal to base-cap-dps), or up to 300k-400k with bonuses if the base-cap-bonus is in the 30k-40k range.  And 2/3rds of those numbers for starships.  And fleet-ship cap-m+c can range from about 4000 ((10m+10c)*198) to slightly north of the Bomber's cost.  And so on
3) Then, looking at a unit as a whole and considering less quantifiable things (has-cloaking, does-reclamation-damage, etc), and try to pick values in each of those ranges such that it is useful but not overpowered.
4) See how much hate it gets, and in which direction, and make adjustments if necessary ;)

Longer term, it has become apparent that the ranges I've been using are probably in need of revision; 5M is probably too low a cap-health for a fleet ship.  The ranges I used for armor seem to be just too low to be significant.  And something with even 150k base-dps with no bonuses doesn't seem to really compare (in popularity at least) with something that has, say, 60k base and 250k max.  But adjustments can be made, and I think it will continue to move towards more fun (which is the point; balance itself isn't the point, it just helps remove impediments to fun).

Hmm, that seems reasonable, and applies many of the things I was trying to measure quantitatively in a qualitative sense, which generally helps handle the "odd" situations. Still, you do use a large amount of decisions based on quantitative data, which is good.

Although I would agree that some of the target stat goals for ship tiers could use some adjusting, the problem is that this is a big change. If the goal for "balanced" and "fair" (balanced and fair not only whiten the tier, but also in relation to other tiers) is shifted, then almost always, everything that was "balanced" right before under the old model suddenly becomes off. Thus, any changes to the goal stats for a ship tier at least requires looking at every unit type in that tier, which for some of the more populated tiers like fleet-ships, is a quite expensive undertaking.
« Last Edit: March 21, 2012, 03:44:10 PM by techsy730 »