|
![[image loading]](http://i.imgur.com/bpttx5e.png) Ever wondered which units are cost-efficient to make against certain types of other units? Wanted to know which unit is countered effectively by which? Well, this thread is aiming to give you an answer to these questions, using very simple mathematic conceptions. These formulae will prove what you mostly already know, and hopefully provide some additional information.
![[image loading]](http://i.imgur.com/P9nVnod.png) The first quantity to speak about is the strength of a unit, relative to another. It expresses how many enemies a unit kills in one game second (gs). It is really not hard to see that it is given by the following formula:
1/n/T, where n is the number of attacks our unit needs to kill the enemy unit, and T is the cooldown time of its attack. What does it mean in reality? If a unit’s relative strength to another is 2, it means it kills two enemy units in one second. If it is 0.5, then it kills half an enemy in one game second, that is, one enemy in 2 seconds. For example, the relative strength of a Hydralisk against a Roach is 0.0952 [1/gs], that against another Hydralisk is 0.1905 [1/gs]. That means, a Hydralisk kills more Hydralisks than Roaches in any time interval. It isn’t surprising at all, since the Roach has more hit points than the Hydralisk, and thus takes more shots to kill.
![[image loading]](http://i.imgur.com/R00pImW.png) Knowing all that is nice, but when speaking about cost-efficiency, we ultimately speak about resources, so it is kind of irrelevant how many units we lose; we would rather want to know how much resource is lost. For that, we simply multiply the relative strength value with the resource cost of the enemy unit. This I call the resource drain, because it tells us how fast a unit drains resources from the opponent by killing their army. A question will immediately arise here: What about minerals and gas? Well, the resource drain could be calculated for both minerals and gas, and treated separately, but I suggest that those two be merged into one value. For this we need a gas coefficient, which determines how many minerals a unit of gas is converted into. Since the maximal mineral collection rate of a base is about 3.5 times the gas collection rate, I would suggest the use of a 3.5 coefficient. Sticking with the above example, the resource drain of the Hydralisk against Roaches is 15.4762 [res/gs], against Hydralisks is 52.3810 [res/gs] (with a gas coefficient of 3.5). So if you kill Hydraisks, your opponent loses resources much more rapidly. Nothing new here.
![[image loading]](http://i.imgur.com/ofHKe91.png) When making these calculations, we also have to consider how big an investment we make to kill enemy units. It is very possible that we have a unit whose resource drain against a certain unit type is twice as great as that of another unit, but it costs five times more. Is it better then? That’s why the RRD is introduced. It is actually nothing more than the resource drain divided by the cost of the given unit (and not the enemy unit, as we had by the resource drain). The RRD basically tells us, how fast the opponent will lose resources for each unit resource invested. The RRD of the Hydralisk against Roaches is 0.0563 [1/gs], against Hydralisks it is 0.1905 [1/gs]. That is, if I make Hydralisks against Roaches, then for each spent resource unit, the opponent may lose 0.0563 resource units each game second.
![[image loading]](http://i.imgur.com/ERMbAaI.png) The value of the RRD in itself doesn’t say too much. OK, the opponent loses resources at this and that rate, but what about me? What do I lose? The cost-efficiency, the ultimate quantity here, is the difference of the RRD of my units against the enemy units and the RRD of their units against mine. If the cost-efficiency is positive, my unit is cost-efficient against the enemy units, if it is negative, it’s cost-inefficient. The cost-efficiency of a unit against the same unit (with the same upgrades) is always 0. Example: The RRD of the Hydralisk against Roaches is 0.0563 [1/gs]; the RRD of the Roach against Hydralisks is 0.1410 [1/gs]. Thus, the cost-efficiency of the Hydralisk against Roaches is 0.0563-0.1410 = -0.0847 [1/gs]. This would mean Hydralisks are cost-inefficient against Roaches.
![[image loading]](http://i.imgur.com/9tCvXZW.png)
Although calculating a unit’s cost-efficiency against another technically isn’t too long or complex, in order to get valuable information, we would have to calculate a lot of efficiency values. To circumvent the problem, I wrote a tiny app that calculates a unit’s efficiency against all other units and vice versa. This way, you can immediately know which counters and is countered most cost-efficiently by which unit.
![[image loading]](http://i.imgur.com/BDzwOrR.png) Browsing the results, some are not surprising, but some really are. Apparently, Ghosts and Sentries are inefficient against almost everything, but it isn’t astonishing, because they are primarily spellcasters.
![[image loading]](http://i.imgur.com/UvNyUrX.png)
If one were to list any ground unit to check its best counters, though, the result would almost always be “Zergling, Zealot, Marine” at the top three. Actually, according to the calculations, the Zergling is cost-efficient against every unit it can attack; the Zealot is only inefficient against the Zergling; and the Marine is only countered effectively by the Zergling, the Zealot, and the Blue Flame Hellbat. Does that mean that Tier 1 units are the best units?
![[image loading]](http://i.imgur.com/3Tl6BUY.png) No, it doesn't (necessarily). And this is where we arrive to the conditions, on which this whole thing works. It is important to note, that this formula does not account for a number of factors which, under certain circumstances, may be far more important than the actual strength of the units. Any kind of area-of-effect damage, be it Colossus splash of Mutalisk’s Glaive Wurms, is not considered as of yet. (Although assigning a certain multiplier to their relative strengths, based on the splash radius and the enemy units’ size, might give a rough approximation.) More importantly, unit speeds, ranges, concaves, army sizes, etc. are unaccounted for. This means, it is impossible to assess a fight based on these numbers. Therefore, of course, if you have a bunch of Roaches, but the opponent has five times as many Hydralisks, you will lose all your army and very likely trade inefficiently, even though Roaches are theoretically efficient against Hydralisks. That is because the cost-efficiency per the above formula is the property of a unit type, not an army. The cost-efficiency number gives a theoretical potential of the unit. If the unit reaches the enemy, if it is still alive, it will deal damage at said rate. Maybe it will strike once and die immediately; maybe it will accumulate 100 kills. It depends on the properties of the engagement, not the unit. And that is the reason why you don’t make a 200/200 Zergling army—even if they reach the enemies before they are killed, which is greatly aided by creep spread, by the way, there is only so big a surface area, so they will not be able to attack all at the same time. A certain amount of Zerglings (or Zealots) in the army may still be cost-efficient, though, and at the same time they act as a “meat shield” for more fragile and/or more expensive ranged units. In case of Marines, though, we see why they are still a viable choice en masse even in the late game—they are ridiculously strong and are also ranged units which counters said problem of Zerglings (and Zealots).
I hope this made at least some sense . I doubt these calculations are very useful regarding strategies, but I definitely found them fascinating. If you have any questions about the topic, feel free to ask them in the comments.
You can download the Unit Efficiency calculator program here.
|
No download? I like to know the stats of Muta 1-2 vs Muta 2-1.
|
Well, I could upload the file somewhere, but it's only half-finished because it lacks the splash damage calculations. Anyway, the Muta attack mechanism is not currently implemented, but I will go write it for you now
|
Wow . . . . , it takes alot time and effort and skill to create this .
I wanna see how terran units fare . .
|
@Dingodile Sure you know that in case of most units (where the attack upgrade increases the damage by 1, and not more) the 1/2 and 2/1 upgrades would cancel each other out. The Muta bounces, however, don't scale that well with the upgrade: the first bounce deals 3 dmg + 0.3333 per upgrade, the second deals 1 dmg + 0.1111 per upgrade. The armor still reduces 1 from the bounces, so that is why armor is prefered over attack upgrade in Muta vs. Muta. Now the way I could implement the bouncing behaviour is that I simply added the damage of the bounces to the main damage. In real combat, the two bounces would hit different units, true, but if there are sufficient numbers, surely there are another two Mutas, whose first and second bounces hit the unit that was hit by a "main attack". That way, it can be assumed that over a period of attack, a Muta is hit by a main attack, a first bounce, and a second one. Based on this, 0/1 Mutas are cost-efficient against 1/0 Mutas; as well as 0/2 vs. 2/0; 0/3 vs. 3/0; and 1/3 vs. 3/1. Strangely enough, though, 1/2 and 2/1 seem to cancel out each other completely, rendering 1/2 and 2/1 equally good. (The cost-efficiency is 0.)
|
I'm pretty surprised that the results show zerglings to be cost-efficient relative to zealots. I tend to cringe when I see zerglings engage zealots, and I assumed the cost-efficiency would at least be close. I guess that even though the ground is covered with zergling blood after the engagement, the zerg probably spent fewer minerals on the dead zerglings than the protoss spent on the zealots (of course dependent on the details of the fight - surface area, etc.). It makes me appreciate how difficult it must be to design a balanced RTS.
|
Well it takes 4 Zerglings to equal one Zealot, and if the Zerglings surround the Zealot, especially with micro, the Zealot won't get four kills. Zealots are only good against Zerglings when they engage in chokes or other positions when the lings cannot surround them.
|
On July 09 2014 03:22 Sholip wrote: @Dingodile Sure you know that in case of most units (where the attack upgrade increases the damage by 1, and not more) the 1/2 and 2/1 upgrades would cancel each other out. The Muta bounces, however, don't scale that well with the upgrade: the first bounce deals 3 dmg + 0.3333 per upgrade, the second deals 1 dmg + 0.1111 per upgrade. The armor still reduces 1 from the bounces, so that is why armor is prefered over attack upgrade in Muta vs. Muta. Now the way I could implement the bouncing behaviour is that I simply added the damage of the bounces to the main damage. In real combat, the two bounces would hit different units, true, but if there are sufficient numbers, surely there are another two Mutas, whose first and second bounces hit the unit that was hit by a "main attack". That way, it can be assumed that over a period of attack, a Muta is hit by a main attack, a first bounce, and a second one. Based on this, 0/1 Mutas are cost-efficient against 1/0 Mutas; as well as 0/2 vs. 2/0; 0/3 vs. 3/0; and 1/3 vs. 3/1. Strangely enough, though, 1/2 and 2/1 seem to cancel out each other completely, rendering 1/2 and 2/1 equally good. (The cost-efficiency is 0.) That's way I asked how your system works with muta clash  The sequence of the upgrades according many many progames is 0-1, 0-2, 1-2 in ZvZ. Your program looks good
|
What you're apparently doing is comparing un-microed units that stand next to each other (melee vs ranged appears to make no difference; ranged units could attack while melee units close the distance), deal no splash damage, have no special abilities and live forever. Maybe you're over-simplifying the whole thing a little.
|
This is a very interesting program! It would be even more exciting if we could download it and try on Starbow(!), since normal Starcraft is well explored and less surprises are expected (Sentries beat Mutas, don't they?!).
However, I think there is a small technical error making results imprecise. You need to consider the *whole* fight until the end. And only if both teams end up 0-0 you can compare costs. The units destroyed per second should be proportional to the total army size. It's hard to explain - basically you can use your RS value and write down a simple differential equation. This will proof that the correct formula would be RRD*=sqrt(RS)/Cost which differs from your equation only by the square root.
I think the best way to test whether your RRD or my RRD* predicts outcomes better, would be to find cases where they have different predictions and try this in the Unit Tester. I'd be happy if you could use your results, compare them to my suggestion (with your program) and report which calculations works more often.
Btw, you basically have RS1=1/((L2/A1)*T1) where A1, T1 are my unit's values and L2 is the life of the opponent's unit. When comparing RS1/C1 tvs RS2/C2 you could bring all unit 1 value on one side and get A1*L1/(T1*C1) vs A2*L2/(T2*C2) This yields an overall unit efficiency more independent of the opponent unit and makes comparing easier. Note, however, that you get different values depending on the active modifiers ("armored" etc). For more precision I suggested to include the square root around all terms other than the cost.
Let me know what you think!
|
Wait. Is this actually enough to get an estimate for efficiency?
|
On July 09 2014 07:21 Khalum wrote: What you're apparently doing is comparing un-microed units that stand next to each other (melee vs ranged appears to make no difference; ranged units could attack while melee units close the distance), deal no splash damage, have no special abilities and live forever. Maybe you're over-simplifying the whole thing a little. Well, I am doing exactly this. Microing units is very complex and, other than that, really depends on the player's skill so it could never be considered. The lack of splash damage is actually an issue, because it makes units like Colossi look useless, when they are of course not. I have an idea to implement splash; I will look into the problem soon. Range is not considered because then a whole engagement should be modelled, rather than a unit, which is extremely complex. As of now, melee units may indeed seem more efficient than in reality, but for example when Charge is upgraded or Speedlings fight on creep, melee units will make it to their targets very fast. Sure, there are quite some simplifications in my calculations, but overall I think the whole thing should work pretty well.
|
On July 09 2014 07:27 Gere wrote: However, I think there is a small technical error making results imprecise. You need to consider the *whole* fight until the end. And only if both teams end up 0-0 you can compare costs. The units destroyed per second should be proportional to the total army size. It's hard to explain - basically you can use your RS value and write down a simple differential equation. This will proof that the correct formula would be RRD*=sqrt(RS)/Cost which differs from your equation only by the square root.
The main purpose was to measure the efficiency of a unit against another unit, and not an army against another army. The efficiency number only gives a potential which a unit can achieve so long as it lives. The best would be, of course, to be able to model an engagement depending on the numbers of either side. This is actually quite complex a task. I don't really understand, though, how you got to the square root formula. As far as I can understand, you are assuming that the rate at which my army is decreasing in size is proportional to the current size of the enemy army (and the ratio is actually the enemy units' relative strength to my units), and vice versa. This is actually called Lanchester's Square Law, and can be written as two simple differential equations, whose solutions will give the two army sizes as a function of time. These will be some hyperbolic functions. I don't know, however, what this has anything to do with that square root you suggested. Anyway, Lanchester's Square Law is unfortunately not applicable to Starcraft engagements, since not all units of an army can attack at the same time (this is not just a theory, I actually tested it).
On July 09 2014 07:27 Gere wrote: Btw, you basically have RS1=1/((L2/A1)*T1) where A1, T1 are my unit's values and L2 is the life of the opponent's unit. When comparing RS1/C1 tvs RS2/C2 you could bring all unit 1 value on one side and get A1*L1/(T1*C1) vs A2*L2/(T2*C2)
Actually, the problem is that L2/A1 can't be separated, because it is not actually L2/A1, but the smallest integer not smaller than L2/A1. This is because units take an itegral number of attacks to kill an enemy; even if, say, 5.6 times their damage would kill it, they will still attack 6 times—see: critical upgrades (but I'm sure you understand it well enough. )
On July 09 2014 07:27 Gere wrote: since normal Starcraft is well explored and less surprises are expected (Sentries beat Mutas, don't they?!).
I'm pretty sure they don't, not without Guardian Shield. My program tells me that Mutas are oh-so-slightly inefficient against +2 Armor/+2 Shield Sentries, though, which is equivalent to the effect of Guardian Shield (and when fighting with a bunch of Sentries, why would you not have Guardian Shield, right? ).
|
On July 10 2014 00:22 Sholip wrote: Anyway, Lanchester's Square Law is unfortunately not applicable to Starcraft engagements, since not all units of an army can attack at the same time (this is not just a theory, I actually tested it).
I didn't know the name - but yes - that's basically what I did. It's much easier if you don't introduce time dependence, but work with invariants. Then you get that the difference of (Total attack rate)*(Total health) between both armies is constant. Thus, for a fair fight you need N1^2*A1*L1=N2^2*A2*L2. You can solve for N1/N2 to introduce cost. That's where my square root comes from.
All of this is still an approximation, as you say, but so is the single unit approach. Luckily, we don't have to theorize about models - we can simply test in the Unit Tester! I don't have the data of units collected. Could you suggest a couple of unit match-ups where your prediction is different from mine? Then I could test in the Unit Tester.
Actually, the problem is that L2/A1 can't be separated, because it is not actually L2/A1, but the smallest integer not smaller than L2/A1.
True, I didn't write a program so I was glad about a simplification. Your program does it better.
I'm pretty sure they don't, not without Guardian Shield. My program tells me that Mutas are oh-so-slightly inefficient against +2 Armor/+2 Shield Sentries, though, which is equivalent to the effect of Guardian Shield (and when fighting with a bunch of Sentries, why would you not have Guardian Shield, right?  ). The good thing is, that we don't have to rely on approximations. There is a very nice Unit Tester in Arcade I will try this week. In Monobattles I would fight with Sentries vs Muta 
|
On July 10 2014 05:42 Gere wrote: the name - but yes - that's basically what I did. It's much easier if you don't introduce time dependence, but work with invariants. Then you get that the difference of (Total attack rate)*(Total health) between both armies is constant. Thus, for a fair fight you need N1^2*A1*L1=N2^2*A2*L2. You can solve for N1/N2 to introduce cost. That's where my square root comes from.
I think I am starting to understand your point . I guess you mean that in a fight according to Lanchester's Square Law, the difference
n1^2 * RS1 - n2^2 * RS2 = constant, where n1 and n2 are the number of units on either side; RS1 and RS2 are the relative strenghts as described in the thread. For a "drawn" fight, where both armies are killed, that makes
n1^2 * RS1 = n2^2 * RS2. If we introduce the cost
C1 = c1 * n1 of one army, where c1 is the cost per unit, we can substitute in the first equation, and for the ratio of costs, we get
C1 / C2 = c1 / c2 * sqrt(RS2 / RS1). Is this square root that square root? Do you suggest the use of this ratio C1 / C2 as the cost-efficiency quantity? This would actually be a nice value to work with, because it has no dimension and you only have to check if it is greater than 1 or not to decide if a unit is cost-efficient. The only thing that bugs me is that I know for certain that Lanchester's Square Law, upon which this whole calculation rests, fails to describe ranged battles in SC, let alone melee units. I will do a writeup on this topic soon.
|
On July 09 2014 05:25 User15937 wrote: Well it takes 4 Zerglings to equal one Zealot, and if the Zerglings surround the Zealot, especially with micro, the Zealot won't get four kills. Zealots are only good against Zerglings when they engage in chokes or other positions when the lings cannot surround them.
generally they break even assuming equal cost, with smaller numbers favouring lings and bigger numbers favouring lots. why you don't want to be fighting zealot warpins with lings is because he will eventually get to a good position, you will run out of larvae and you will not be producing drones for a long time.
|
Are you taking into account the passive regen on zerg units? It makes a difference in Roach vs Roach (I've done the calculations for that one for ZvZ analysis).
|
On July 10 2014 05:42 Gere wrote:The good thing is, that we don't have to rely on approximations. There is a very nice Unit Tester in Arcade  I will try this week. In Monobattles I would fight with Sentries vs Muta 
Fight like a real Z, stack up, snipe sentry and pull back before loosing too many, wait regen.
The simple fact that this "unit value" program assumes 1v1 a-move and doesn't take into account basic micro, walling of and range/surface area (and tech/price/time to build...) makes it an interesting academic research with absolutely no in-game value.
|
On July 11 2014 00:12 Gowerly wrote: Are you taking into account the passive regen on zerg units? It makes a difference in Roach vs Roach (I've done the calculations for that one for ZvZ analysis). I assumed that units die fast enough during a battle for Zerg regeneration to only matter if the unit's health is divisible by the damage it takes after each attack. For example, a Marine deals 5 damage to a Roach if neither are upgraded, but it doesn't kill it in 145/5 = 29 shots. I assumed that in these cases, the amount of attacks needed is increased by one, so the Roach would die from 30 shots. This assumption is valid so long as each unit dies in less than 3.7 game seconds (about 2.65 real seconds), the time it takes for a Zerg unit to regenerate 1 hit point (if we exclude the rare cases where fractional damage is dealt).
|
Well I think it does have 'some' in game value depending on how you apply it. Most of us do something similar to this anyway through experience. You scout, build counters and try to be cost efficient. Some of the things won't hold up and will vary on the circumstance of the engagement.
Even removing the whole terrain/engagements and even micro from the equation, it will still vary depending on army size. We all know in smaller numbers marines aren't near as powerful as larger numbers. There are many game situations where armies create a critical mass of damage. You could send in 150 supply worth of lings against 12 collosus and i doubt they would kill one b/c they will melt. It's also why zealots and zerglings are almost worthless in endgame armies because maxed out armies will always have enough ranged dps to instantly melt them, even in large numbers. (speed and charge doesn't change this either)
Upgrades and spellcasters throw a wrench into all of this too. We all know about critical upgrades like +1 zealots against lings. And 3/3 marines with stim/combat sheild/medivacs are a completely different animal. I'd say marines at only 50m would definately be the most cost efficient unit in the game. Spellcasters alter just like upgrades. We've all saw a handful of gateway units smash a force of bio after a storm or two. I doubt upgraded collossus trade bad against any ground unit. Ghosts u say look bad on paper but a couple emps will allow your whole army to trade better. These are also much stronger in high numbers as their range and high dmg can melt many times their supply. (just go into unit tester and see what it takes to kill 15-20 ghosts.)
I could go on and on but we all know this stuff. I do want to say I enjoyed the post though and I think your train of thought is spot on. I feel this information CAN be applied to games. Depending on how you apply it, this information can only help ppl grow as a player so I hope I didn't come off wrong. Thanks for the post!
|
Well, of course I didn't really expect to "discover" something that has not been known before . It's mainly just proving things we already know/suspect using numbers.
On July 11 2014 01:18 Axxis wrote: Even removing the whole terrain/engagements and even micro from the equation, it will still vary depending on army size. We all know in smaller numbers marines aren't near as powerful as larger numbers.
Of course it depends on the army sizes. But if we just consider the cases when the engagement is a "draw", as Gere suggested,
On July 09 2014 07:27 Gere wrote: And only if both teams end up 0-0 you can compare costs.
we could give a cost ratio regardless of army sizes if the assumptions for the Lanchester Model were true. Which they unfortunately aren't, except for maybe air vs. air battles.
|
Following Gere's suggestions, I added the "Lanchester efficiency" to my program. The smaller this number, the more efficient the unit. Any unit against the same unit type has this value as 1. This kind of efficiency yields almost always the same best/worst counters for a unit as my theory, so that's something at least I think . If everything is going according to plan, you can download the latest version of the app here and find what you are curious about!
|
On July 10 2014 23:58 Sholip wrote:C1 / C2 = c1 / c2 * sqrt(RS2 / RS1). Is this square root that square root?  Do you suggest the use of this ratio C1 / C2 as the cost-efficiency quantity? This would actually be a nice value to work with, because it has no dimension and you only have to chech if it is greater than 1 or not to decide if a unit is cost-efficient. The only thing that bugs me is that I know for certain that Lanchester's Square Law, upon which this whole calculation rests, fails to describe ranged battles in SC, let alone melee units. I will do a writeup on this topic soon. Yes, that's exactly the square root. Lanchester's square law should only break down if the assumptions don't hold well. This would be, if not all units attack at once or one unit types lifes much longer (i.e. fight is more discrete). Everything is an approximation, but i remember having good predictions for Zergling vs Zealot in SC1.
Anyway, I believe in empirical tests. Neither method is perfect, but I'd be really interested to know which method matches the Unit Tester better For this, it would be helpful if you check where predictions between both models differ.
|
On July 11 2014 03:59 Sholip wrote:If everything is going according to plan, you can download the latest version of the app here and find what you are curious about! Nice tool! It would be great if the tool would also check for a text file in the same directory to read in the unit data. This way I could try to put Starbow data and play with that
|
On July 14 2014 14:37 Gere wrote:Nice tool! It would be great if the tool would also check for a text file in the same directory to read in the unit data. This way I could try to put Starbow data and play with that  Well, I should be able to do that.
|
|
|
|