Grid Sage Forums

Grid Sage Forums

  • November 23, 2024, 08:04:43 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

LINKS: Website | Steam | Wiki

Author Topic: Coverage Vs Integrity Formula  (Read 8196 times)

SimonScience

  • Unaware
  • *
  • Posts: 3
    • View Profile
Coverage Vs Integrity Formula
« on: December 12, 2018, 03:30:01 PM »

Coverage Vs Integrity Formula
Quick notes:
My math may be wrong here, so feel free to correct me if i'm wrong.
I'm not that good at the game yet! I've only gotten to reaserch recently. So if anything I say dosent make sense for the late game, thats why.

In the game, how long an item is going to last (while in use) is decided by two variables:

Integrity is the amount of damage that part can take before it is destroyed
Coverage is the chance that item takes damage

Therefore, there is a tricky question that comes up on how to compare the "durability" of items that have inverse relations of integrity and coverage.

For example, take the Compact Whell vs the Wheel (the comparison that made me do this in the first place)

Wheel:
Integrity:40
Coverage:50

Compact Wheel:
Integrity:30
Coverage:30

The Wheel is more durable, AKA it can tank more damage, but the Compact Wheel has less coverage, AKA it is less likeley to take damage in the first place. So, how do we find out which will last longer?

Awnser: A lot of math.

So first off, because the odds of getting hit is proportional to the rest of the coverage on Cogmind, this measure assumes the rest of the coverage on Cogmind will stay the same. Of course, this isint really true. Other parts can break and lower your coverage drastically. But, if we assume that you are doing this calculation for an item you dont want to break, we can assume you have spares or a good suply of those other items (or at least items of similar coverage). If you attach a new part that has drastically more or less coverage, you can just recalculate.

I'm going to name this new value "Expected Durability", as it represents how much damage you can expect to take before that item breaks:


Where C is combination (nCr, see: https://en.wikipedia.org/wiki/Combination)
And L is a large number. The larger L is, the more accurate your reading of Expected Durability. L should allways be bigger then your durability. You can think of L as up to how much damage you are checking.

Here is an example to help:

Here, i've plotted the Expected Durability of Wheels(Black) and Compact Wheels(Red) for the rest of the coverage on Cogmind(c). Because our L is only 250 (due to the difficulty of plotting reapeated formulas), it is definetly only accurate up to c = 250, less if we want to be rigourous (I would guesstimate c = 200, but if you want to be strict, c = 100 works too) . The lower numbers of the plotting are still accurate enough though. I accidentally closed the window that had those plots, but I can at least say that somewhere between c = 70 and c = 80, compact wheels overtake wheels for expected durability. Therefore, if you have that much coverage, compact wheels are just better then wheels, period (as they have superior stats in mobility and support).
« Last Edit: December 12, 2018, 04:07:45 PM by SimonScience »
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Coverage Vs Integrity Formula
« Reply #1 on: December 12, 2018, 05:29:43 PM »

Welcome SimonScience! And interesting observations :D

On a related note, not sure if you've seen it yet but in game we have a "relative vulnerability" graph (press 'c' twice--it's paired with the coverage graph in the UI), which compares all of your parts by how likely they are to be destroyed next given their current remaining integrity, and it's generally pretty accurate (of course, there are too many variables to predict it perfectly, not to mention there's the RNG involved, but it's good for quick comparisons!). The formula there is essentially just... (coverage / integrity) :P
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

SimonScience

  • Unaware
  • *
  • Posts: 3
    • View Profile
Re: Coverage Vs Integrity Formula
« Reply #2 on: December 13, 2018, 09:30:53 AM »

Welcome SimonScience! And interesting observations :D

On a related note, not sure if you've seen it yet but in game we have a "relative vulnerability" graph (press 'c' twice--it's paired with the coverage graph in the UI), which compares all of your parts by how likely they are to be destroyed next given their current remaining integrity, and it's generally pretty accurate (of course, there are too many variables to predict it perfectly, not to mention there's the RNG involved, but it's good for quick comparisons!). The formula there is essentially just... (coverage / integrity) :P
Thankyou! I did not notice that relative vulnerability graph (So thats what the red thignys mean! :P ). Though for a more in depth analysis Coverage/Integrity ratio wont give an accurate rating, as seen with Compact wheels vs Wheels. As a quick comparison tool though Coverage/Integrity seems to work fine  ;D .

I would suggest using the formula (if it is correct) when planning out a build or for trying to analyse stuff like Compact Wheel vs Wheel. I often use wheels in my runs and knowing which wheel to keep in a limited inventory helps (yes you can get them from neutral bots but attacking them withought a datajack is risky due to the distress signal. Datajacks are about as sturdy as dry spaghetti so swapping it out is the only realistic way of preserving it, which can be a problem because of matter). I currently have two builds I tinker with in my runs, which I may post to get some help with the game :P.
Logged

Valguris

  • Cyborg
  • ***
  • Kyzrati Patron Bug Hunter Weekly Seed Participant Shared a Confirmed Stealth Win
  • Posts: 148
    • View Profile
Re: Coverage Vs Integrity Formula
« Reply #3 on: December 13, 2018, 04:59:50 PM »

Hi SimonScience!

If I understand it correctly, you calculate the probability of an item surviving up to D damage by multiplying the probabilities that the item survives exactly d damage (let us call their corresponding events A_d). However, events A_d are dependent on eachother, so simple multiplication won't yield the desired probability. I also do not understand where is the division by (L - Integrity) coming from.

I believe that "which point of damage will destroy the part" follows https://en.wikipedia.org/wiki/Negative_binomial_distribution + the number of "failures". Then the expected value equals pr/(1-p) + r, where p=(1-PartCoverage/TotalCoverage) and r=Integrity, which results in (Integrity/PartCoverage)*TotalCoverage. So it turns out that Integrity to PartCoverage ratio is not the exact expected durability (using your definition), but it's closely related (note that TotalCoverage depends on PartCoverage).

Heh, I was expecting to get exactly Integrity/PartCoverage.
Logged

SimonScience

  • Unaware
  • *
  • Posts: 3
    • View Profile
Re: Coverage Vs Integrity Formula
« Reply #4 on: December 13, 2018, 06:34:49 PM »

The division is so that it calculates the Expected Value (https://en.wikipedia.org/wiki/Expected_value), which is given by finding the mean of each result. Tbh it took me awhile to understand it too: I had to do a lot of trial and error before I got an equasion that spat out numbers that made sense. Essentially, it calculates the chance of survival at a damage, then multiplies that by the chance of survival at the next damage and so on, which gives you the chance of survival of those damages combined. So the reapeated multiplication gives the chance that it survives up to that damage, and then it multiplies that value by the turn number and means it to find the expected value, which is therefore the expected damage at wich it survives!

 :P (still not sure though lol)
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Coverage Vs Integrity Formula
« Reply #5 on: December 14, 2018, 04:51:40 AM »

As a quick comparison tool though Coverage/Integrity seems to work fine  ;D .
Heh, yeah that's all it's for anyway, just a general idea of what you might lose first. In other words, a quick way to get an at-a-glance view of what you really need to prepare to replace at a moment's notice :P
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

Valguris

  • Cyborg
  • ***
  • Kyzrati Patron Bug Hunter Weekly Seed Participant Shared a Confirmed Stealth Win
  • Posts: 148
    • View Profile
Re: Coverage Vs Integrity Formula
« Reply #6 on: December 14, 2018, 05:47:25 AM »

This
it calculates the chance of survival at a damage, then multiplies that by the chance of survival at the next damage and so on,
does not equal this
which gives you the chance of survival of those damages combined
They would be equal, if the correspoding events were independent (https://en.wikipedia.org/wiki/Independence_(probability_theory)#Independent_random_variables). But they are not. It's like rolling a 6-sided die and saying that the probability of getting 4 or higher ( 50% ) equals the probability of not rolling a 1, multiplied by probability of not rolling a 2, multiplied by probability of not rolling a 3, which gives (5/6)^3.

The division is so that it calculates the Expected Value (https://en.wikipedia.org/wiki/Expected_value), which is given by finding the mean of each result
That is also incorrect. You should calculate the mean by multiplying the numerical value of each result by the probability of its occurence. No need for further division. Take a 6-sided die roll as an example again. Expected value of the rolled number is

where p_i = 1/6 (probability of rolling i) for each i. There is no need to divide this again by the number of possible results -- the averaging was taken care of via weighting each result by its probability!


Ah, and since the expected lifetime of a part equals (Integrity/PartCoverage)*TotalCoverage, and all your parts share the same value of TotalCoverage, then to compare item's expected durability you only need to compare their Integrity/PartCoverage ratio! Kyzrati's way is the correct way -- now proven mathematically!
...With a caveat that we assume that each point of damage rolls independently for which part it hits. Which is not true, since damage comes in chunks (shots). The difference is the most noticeable for parts with current integrity so low as to be destroyed within 1 or 2 hits (math geeks playing boardgames are probably familiar with this phenomena, since those games work with much fewer rolls than video games). I will not provide mathematical proof for this, but give an example instead:
Consider a part with 10% coverage and only 10 integrity remaining. A single 10 damage shot has 10% chance to destroy it. If we split this damage into n chunks, then the chance for destroying this parts equals (1/10)^n, which is 1/100 for 2 shots of 5 damage, or an astronomically low 1/10000000000 for 10 shots of 1 damage each (this last way is how Integrity/PartCoverage bases off its estimate). This also shows that damage reduction (Force Field, Thermal Shield, etc.) might be better than coverage for protecting those low integrity items, for example 50% damage reduction more than doubles life expectancy of those parts; to accomplish similar effect you'd have to more than double your TotalCoverage.

Unfortunately, accounting for "chunked" nature of damage requires the knowledge of received hits distribution (i.e. which weapons and how often hit you across a floor/ across a run/ across the next encounter, etc..., which depend on your build (avoidance), tactics you employ (short-ranged vs long-ranged, stealth, running from slow enemies but not from swarmers...) and map generation (which enemies you encounter, how close you come up on them). So the Integrity/PartCoverage is probably the best we can ever have.

TLDR for those, who want to skip all this math:
  • Integrity/PartCoverage is the best metric to compare durability of items that we can mathematically analyze
  • Life expectancy of a part (expected amount of damage received by Cogmind before that part gets destroyed) is (Integrity/PartCoverage)*TotalCoverage
  • The above two measures greatly overestimate life expectancy of parts with very low current integrity (those that will get destroyed in 1-2 shots), such as hackware
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Coverage Vs Integrity Formula
« Reply #7 on: December 14, 2018, 06:08:05 AM »

Kyzrati's way is the correct way -- now proven mathematically!
Wow, I did a mathy thing and it came out right? Speechless. Locking thread. No more digging into this, nope that's the end of it ;)
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

zxc

  • Cogmind
  • *****
  • 1st place in the High Scores category during Alpha Challenge 2015 1st place in the Best Escapes category during Alpha Challenge 2015 Shared a Confirmed Combat Win Shared a Confirmed Stealth Win Kyzrati Patron Bug Hunter Achievement leader in at least one category during Alpha Challenge 2015 Participated in the Alpha Challenge 2015 Wiki Contributor Weekly Seed Participant
  • Posts: 726
    • View Profile
Re: Coverage Vs Integrity Formula
« Reply #8 on: November 18, 2019, 11:12:15 PM »

Interesting read, guys!
Logged