[Guide] How to compute 'hit pattern' data

Discussion in 'Infiltrator' started by Frightning89, Aug 5, 2016.

  1. Frightning89

    So I figured out a rather nice way to math out how many hits it takes to kill an enemy in a way that you can compute that information for all situations with a minimum of effort. I will use the NC04 Mag-Shot as an illustrative example:

    The NC04 Mag-Shot has damage values of:
    200@10m-112@60m

    This of course, means that within 10m it does 200 damage, and beyond 60, it does 112. In between those extremes, damage decreases linearly from 200 to 112 (which results in the 'ramp shaped' damage graphs you're probably used to seeing when looking at guns in this game). It's not hard to compute how many hits it takes to kill a target, but what gets tricky is when you start to try and account for things like Infiltrators have only 400 shields, or Heavy Assaults having a 450 hp overshield (their class skill). There's also Nanoweave Armor, which reduces damage from small arms (does not affect headshots, btw) 20% for suit slot version, 25% from Nano Armor Cloak at ranks 1-4, 35% at rank 5. As you can see, there quickly become quite a few different scenarios to contend with, which if you tried to work out each one individually could become rather tedious. So the idea is convert the weapon's damage profile into a corresponding 'hit equation', which can then easily be adjusted to the scenario of interest.

    Deriving the hit equation:
    To derive the hit equation, begin with the standard infantry case, 1000 hp (500 shield, 500 health). Compute hp/max damage, and hp/min damage, which in this case are:
    1000/200=5 and 1000/112=8.9(285714) (or in reduced fraction form, 125/14)
    (Note: when digits after a decimal point appear in parentheses, that means that the sequence of digits therein represents a repeating decimal, hence .9(285714)=.9285714285714...etc.)
    These are two of the three pieces of the equation, they represent the constant parts for range<10m and range>60m respectively. What remains now, is to compute the equation for the section in between, which we know will be a linear equation. Let r denote the range in meters, and define h(r) to be the hit value at range r, thus we seek to find m and b for the equation:
    h(r)=mr+b
    This is the slope-intercept form of the equation of a line. m can be found using the max and min hit values and their corresponding ranges via the formula:
    m=(y_2-y_1)/(x_2-x_1)
    where we let the y's be hit values, and x's be the corresponding ranges. Let y_2=8.9(285714) and correspondingly, x_2=60m, and let y_1=5 hence x_1=10. This gives:
    m=(8.9(285714)-5)/(60-10)=3.9(285714)/50=0.07(857142)
    We now know that:
    h(r)=0.07(857142)r+b
    Hence we need only to find b. This is easily done using either hit value and its corresponding range. We use the fact that h(10)=5 to solve for b.
    5=0.07(857142)5+b
    5=0.39(285714)+b
    b=5-0.39(285714) (changed which side of the equation was which here, and subtracted from both sides)
    b=4.2(142857)
    Thus we have found the middle section of the hit equation to be:
    h(r)=0.07(857142)r+4.2(142857)Which is valid for 10<r<60 (including r=10 and r=60 actually).
    The full equation is a piecewise linear equation which has two constant pieces, the piece for r<10 is:
    h(r)=5
    which we found earlier, and likewise, for r>60m
    h(r)=8.9(285714)
    which was also found earlier.

    Usefulness of hit equation:
    This equation is perhaps more useful than is immediately apparent. For the standard case, you can compute exactly how many hits are needed at any range by simply 'plug-and-chug' computing. The resulting value is a decimal value, that actual number of body shots required is the ceiling of that number (i.e. round it up to next integer). What if you are interested in looking at hit patterns that mix headshots with body shots? This is easy to account for with this equation, headshots with the Mag-Shot (and most other weapons) do +100% more damage, that means that do exactly as much damage as two body shots. Hence each headshot just 'count as two' body shots. So a hit value of 1 is corresponds to body shot on 1000hp target w/out nanoweave), and a headshot would have a value of 2. In this way, it's easy to tell if a particular hit pattern would be enough damage or not, just check the sum of the hit values against the equation's output for the range in question. The real power of this equation is in how easily it can be adapted to deal with all of the other cases. Suppose you wanted to change the situation to an overshielded HA, instead of rederiving the h equation from stratch, you easily adjust it by simply multiplying all of the numbers appearing in each piece of the equation by 1.45. Why 1.45? Because that is is hp ratio between the actual situation of interest, and the standard scenario 1450hp/1000hp=1.45. Likewise for Infiltrator, multiple the numbers by 0.9 for that case. You can also account for Nanoweave in a very slick manner: Max rank Nanoweave provides 20% resistance to body shots only (not to headshots). So you can adjust the value of a body shot from 1 to 0.8, hence a hit value of 4.5 would call for 6 body shots (5*0.8=4<4.5, 6*0.8=4.8>4.5) in practice instead of 5 (5*1=5>4.5, 4*1=4<4.5) due to the nanoweave resistance. One application of this is to compute a complete set of hit pattern data for a case of interest, I have done so, using the above formula for the standard infantry case with the NC04 Mag-Shot. I used the results and some other clever calculations to recover exact range data and overkill damage values as well, resulting in the following data (where HS=headshot and BS=body shot):
    Standard Infantry:
    0-10m:
    3HS: 1200 (200 overkill)
    2HS+1BS: 1000 (0 overkill)
    1HS+3BS: 1000 (0 overkill)
    5BS: 1000 (0 overkill)
    10-22.(72)m:
    3HS: 1200-1000 (200-0 overkill)
    2HS+2BS: 1200-1000 (200-0 overkill)
    1HS+4BS: 1200-1000 (200-0 overkill)
    6BS: 1200-1000 (200-0 overkill)
    22.(72)m-35.(45)m:
    4HS: 1333.(3)-1142.(851742) (333.(3)-142.(857142) overkill)
    3HS+1BS: 1166.(6)-1000 (166.(6)-0 overkill)
    2HS+3BS: 1166.(6)-1000 (166.(6)-0 overkill)
    1HS+5BS: 1166.(6)-1000 (166.(6)-0 overkill)
    7BS: 1166.(6)-1000 (166.(6)-0 overkill)
    35.(45)m-48.(18)m:
    4HS: 1142.(857142)-1000 (142.(857142)-0 overkill)
    3HS+2BS: 1142.(857142)-1000 (142.(857142)-0 overkill)
    2HS+4BS: 1142.(857142)-1000 (142.(857142)-0 overkill)
    1HS+6BS: 1142.(857142)-1000 (142.(857142)-0 overkill)
    8BS: 1142.(857142)-1000 (142.(857142)-0 overkill)
    48.(18)m-60m+:
    5HS: 1250-1120 (250-120 overkill)
    4HS+1BS: 1125-1008 (125-8 overkill)
    3HS+3BS: 1125-1008 (125-8 overkill)
    2HS+5BS: 1125-1008 (125-8 overkill)
    1HS+7BS: 1125-1008 (125-8 overkill)
    9BS: 1125-1008 (125-8 overkill)

    Data like this can be very informative for getting a sense of where a weapon's effective changes and by how much, for instance, we see that the NC04 Mag-Shot remains quite lethal out to 22.(72)m, being able to still get a 3HS kill just as it can within 10m, though within 10m, one of the HS can be a BS instead.
    • Up x 1