Basic Efficiency Models

Introduction

Each of these models assigns an efficiency value to each unit. Efficiency basically describes how much bang you get for your buck. A given model will describe how good a unit is at a particular task, which we will call "power", and then divides that number by the "cost" of the unit to arrive at the unit's "efficiency". I put these terms in quotes because their meaning depends on the particular model. I will offer (informal, in the interest of brevity) derivations for each model.

Also see  http://en.wikipedia.org/wiki/Mathematical_model.

What is Power?

Anything you want it to be. It depends on what you are trying to measure about a unit. For example, if you are trying to determine what worker is best for assising a factory, you might create a model where a unit's power is equal to its worker time.

What is Cost?

Again, anything you want it to be. It depends on what situation you are trying to measure the cost of a unit in. For example, if you are measuring the cost of a unit in a metal maker economy, you might use metal cost + energy cost / 100 + build time / 500 as your cost. This will make your model good for metal maker economies, but less good for, say, the early game where you are not typically running a metal maker economy, or SpeedMetal?. For purposes of this article, let us define the following:

CostMM = metal cost + energy cost / 100 + build time / 500

What is Efficiency?

In terms of numbers, efficiency is just power / cost. The higher a unit's efficiency, the better it is under your model. This does not necessarily mean that a unit with a higher efficency under a given model is better overall, but it will mean that the unit is a better choice in situations resembling that of your model. The use of efficiency assumes that the effectiveness of a group of units is proportional to the size of the group.

Resourcing

Resource production can give the simplest efficiency calculations--a unit's power is equal to the value of the resources it produces minus the resources that it uses, divided by its cost. Note that worker time is also a resource, although somewhat more complex (see Economy Guide). Under a metal maker economy, a rough estimate is that 1 metal is equal to 100 energy, or 500 build time:

Resourcing Power = (metal make + energy make / 100 + worker time / 500) - energy use / 100

Combat

Basic Duel

As always, we start simple, and here is one of the simplest combat models imaginable. We make the following assumptions:

  • Each unit has only two attributes: HP and DPS.
  • Damage is applied perfectly continuously.
  • Each unit's remaining DPS is independent of its hit points.

We then (mathematically) evaluate the units under the following situation, which is where this model gets its name:

  • Choose two units.
  • Plop down one of each next to each other and have them fight.
  • Whenever one dies, replace it and continue.
  • Compare how much cost is being spent on each unit.

The power of a unit under this model is then equal to how much enemy it can destroy before being destroyed itself. Since it is taking damage at a constant rate, its time of survival is proportional to its HP; and of course the rate at which it does damage is equal to its DPS. Thus, under this Basic Duel Model:

Basic Duel Power = HP * DPS

Basic Duel Efficiency = HP * DPS / Unit Cost

Basic Swarm

"Well, that's a start," you say, "but nobody in their right mind sends a single Jeffy at a time to a Krogoth duel! This model is absurd!" And you are right--a better comparison would be not between equal numbers of units, but equal costs of units. So, let us keep our assumptions, but change the situation slightly:

  • Choose two units.
  • Plop down a swarm of equal cost of each next to each other and have them fight.
  • Whenever a unit dies, replace it and continue.
  • Compare how much cost is being spent on each unit.

The HP of each swarm is equal to the HP of its individual units times how many units there are, and likewise with DPS. The number of units is equal to the cost of the swarm divided by the individual unit cost. From where, the power squared is:

(Basic Swarm Power)2 = HP * (Swarm Cost / Unit Cost) * DPS * (Swarm Cost / Unit Cost) = HP * DPS * (Swarm Cost)2 / (Unit Cost)2

This is the power squared since the swarm cost is squared in the expression. From here,

Basic Swarm Power = sqrt(HP * DPS) * Swarm Cost / Unit Cost

and, dividing by the swarm cost,

Basic Swarm Efficiency = sqrt(HP * DPS) / Unit Cost

This is the same result as the Basic Duel, except for the square root.

Basic Duel, Basic Swarm, and Reality

  • Obviously, neither model takes into account anything besides HP and DPS.
  • In practice, the Basic Duel model tends to overestimate large units (because nobody sends small units in one at a time).
  • In practice, the Basic Swarm Model tends to overestimate small units. There are many reasons for this, but the two greatest reasons are splash damage and crowding.
    • Splash damage means that, after a point, a large, packed swarm is not really more durable than a small, more spread-out, swarm. Thus, a cheaper unit with a better Basic Swarm Efficiency may not actually do as well as a more expensive one because each shot deals damage to more of them at the same time.
    • Likewise, crowding limits the number of units that can actually attack the enemy at a time.
  • Fitting parameters to data, as of r1632, assault units are priced roughly by (HP * DPS)0.7.

TBC

Refinement: The Corridor Approximation

The corridor approximation is a first attempt to include range in the calculation. Suppose the two units are not automatically in range of each other, but instead are engaging each other in a "corridor" of limited width, somewhat like two perfectly-organized blocks of infantry engaging each other head-on. We make the same assumptions as before, except that now only the units within their range of the line of battle can attack. This has the effect of multiplying the effective DPS of each unit by its range; the number of units that can fire at the enemy is proportional to their range.

Basic Duel Corridor Efficiency = HP * DPS * Range / Unit Cost

Basic Swarm Corridor Efficiency = sqrt(HP * DPS * Range) / Unit Cost

The "duel corridor" (although the term "duel" is somewhat of a misnomer here) corresponds to the case where the units are equally packed on each side, while the "swarm corridor" corresponds to the case where the costs are equally packed (that is, if you take an equal area from each side, the total cost of the units in that area is the same for both sides).