Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Armor damage visualization should scale non-linearly  (Read 530 times)

BigBrainEnergy

  • Admiral
  • *****
  • Posts: 698
    • View Profile
Armor damage visualization should scale non-linearly
« on: March 11, 2024, 11:08:39 AM »

Armor damage on the HUD is shown by the colour of the armor modules in the display, but right now there's a problem with this: the way the armor fades out appears to scale linearly with how much armor is left. This is a problem because it does not play nicely with the armor damage-reduction mechanic, where dealing damage to take an enemy from 2000 to 1000 is much harder than going from 1000 to 0. This gives a false sense that you aren't making progress at all with your first few shots, and then suddenly you hit a turning point where the remaining armor is stripped very quickly.

It would be better for the player if the "fade out" of armor modules in the ui scaled in a non-linear fashion, where the first points of damage have a much higher impact than later points on the visualization.
« Last Edit: March 11, 2024, 11:10:33 AM by BigBrainEnergy »
Logged
TL;DR deez nuts

Wyvern

  • Admiral
  • *****
  • Posts: 3803
    • View Profile
Re: Armor damage visualization should scale non-linearly
« Reply #1 on: March 11, 2024, 11:12:10 AM »

Huh. Yeah, now that you mention it, this sounds like* a good idea.

Same goes for the player ship's armor grid, I'd think.

* I say "sounds like" because this is also the sort of thing where I'd really want to get some playtesting in to see how it feels in actual play before saying "yes, absolutely do this".
Logged
Wyvern is 100% correct about the math.

Üstad

  • Commander
  • ***
  • Posts: 131
    • View Profile
Re: Armor damage visualization should scale non-linearly
« Reply #2 on: March 11, 2024, 11:43:11 AM »

Sounds like a good idea to me.
Logged

nathan67003

  • Commander
  • ***
  • Posts: 158
  • Excellent imagination, mediocre implementation.
    • View Profile
Re: Armor damage visualization should scale non-linearly
« Reply #3 on: March 12, 2024, 05:44:37 AM »

...I'd MUCH rather have a clear depiction of the actual armour left than a pre-calculated value for whatever reason. I can very easily do the math myself; obfuscating the values 'for the feel of it' is just horrible, horrendous UX.
Logged
I have some ideas but can't sprite worth a damn and the ideas imply really involved stuff which I've no clue how to even tackle.

Megas

  • Admiral
  • *****
  • Posts: 12159
    • View Profile
Re: Armor damage visualization should scale non-linearly
« Reply #4 on: March 12, 2024, 06:30:34 AM »

And there are few weapons that bypass armor DR, like Breach or Omega's Disintegrator.
Logged

BigBrainEnergy

  • Admiral
  • *****
  • Posts: 698
    • View Profile
Re: Armor damage visualization should scale non-linearly
« Reply #5 on: March 12, 2024, 06:34:33 AM »

...I'd MUCH rather have a clear depiction of the actual armour left than a pre-calculated value for whatever reason. I can very easily do the math myself; obfuscating the values 'for the feel of it' is just horrible, horrendous UX.

This ain't a maths question brother, I'm talking about the fact that even after shooting the same spot multiple times you literally can't tell that any damage has been done unless you look very closely for a subtle difference in shading, and then all of a sudden it gets stripped completely by the next 2 shots. Nothing about that fits the description of "clear."

And there are few weapons that bypass armor DR, like Breach or Omega's Disintegrator.

 I don't consider this a problem. Flat damage to armor is much more impactful against higher armor values, so it fits.
« Last Edit: March 12, 2024, 06:38:57 AM by BigBrainEnergy »
Logged
TL;DR deez nuts

nathan67003

  • Commander
  • ***
  • Posts: 158
  • Excellent imagination, mediocre implementation.
    • View Profile
Re: Armor damage visualization should scale non-linearly
« Reply #6 on: March 13, 2024, 06:15:43 AM »

even after shooting the same spot multiple times you literally can't tell that any damage has been done
Consider that it's because no significant damage has been done.
Logged
I have some ideas but can't sprite worth a damn and the ideas imply really involved stuff which I've no clue how to even tackle.

BigBrainEnergy

  • Admiral
  • *****
  • Posts: 698
    • View Profile
Re: Armor damage visualization should scale non-linearly
« Reply #7 on: March 13, 2024, 08:25:28 AM »

Consider that it's because no significant damage has been done.

Except it *is* significant, because you've reduced the damage reduction the armor gets even if the raw value hasn't decreased much.
Logged
TL;DR deez nuts

prav

  • Captain
  • ****
  • Posts: 396
    • View Profile
Re: Armor damage visualization should scale non-linearly
« Reply #8 on: March 13, 2024, 12:21:13 PM »

If you go with something straight forward like cell alpha = armor level ^ 2 you get:
90% armor -> 81% brightness, which is fine
and
40% armor -> 16% brightness, which is practically invisible. But 40% armor is not negligible, on many ships you're still absorbing most damage on most shots - not everything is a Hellbore.

Reducing the exponent makes the whole thing pointless, and increasing it makes the problem even worse. I suppose you could go with some obscure threshold formula that should probably include perception response curves, but that starts to feel quite far out into the weeds.

You could add a second axis, such as cells going green (1) -> red (0.5) -> black (0) for further differentiation. But then the hud is no longer monochromatic.

Sometimes simple is best.
« Last Edit: March 13, 2024, 12:22:53 PM by prav »
Logged

prav

  • Captain
  • ****
  • Posts: 396
    • View Profile
Re: Armor damage visualization should scale non-linearly
« Reply #9 on: March 13, 2024, 12:34:28 PM »

I'm halfway expecting Alex to post "uh... it's already squared".
Logged

Goumindong

  • Admiral
  • *****
  • Posts: 1896
    • View Profile
Re: Armor damage visualization should scale non-linearly
« Reply #10 on: March 14, 2024, 03:13:13 AM »

The obvious answer is to mimic the armor damage reduction equation but that doesn't work

But exponents do! You're just looking at the wrong exponent. The one we want is natural. Such that we can define a constant percentile change throughout the armor. I.E. going from 100% to 80% is the same reduction as going from 80% to 64%!. We also want this because our armor equation is 1/(1+x) = 1+1/x and the integral of 1+1/x in the area above 0* is a logarithm* (usually defined as log a = area under 1/x between 1 and a). And the inverse of a logarithm is the exponential. So by using the exponential function we are, quite literally, reversing the armor damage reduction equation! Well... we reverse one of them. There is a unique one for every hit strength weapon in the game. So we are just going to have to pick and choose "what looks right"

e^armor doesn't work. Because well. Its not formatted properly. We need this to work for all ships to have the same armor visibility gradient that matches what we want. And also we maybe want to parameterize this so that we can choose the amount of the curve

So here we are! e^(K*armor/max armor-K)

Where K is a constant that we like the curve at.

This scales the value of the graph between zero and 1 because at armor = max armor this is e^k-k= e^0. =1. But we have a problem at armor = 0 this is e^-k and not 0 or a value of our choosing. It does approach zero as k increases. But this gives us a smooth curve that decreases swiftly and for which we can tailor to our particular needs of curvature! Indeed we don't even have to use the natural number here but changing the number is equivalent to changing the exponent so we might as well.

Changing the zero point is a bit harder. We have to add a scalar to our armor value that is not easy to calculate and will change depending on the gradient we want to show at zero armor.

If that number if zero then our equation now looks like... e^(log(1 + e^k)*(armor%)-k)-e^-k

Generalized to any value we want to set as our gradient value when armor is zero this is e^(log(1 + e^k - e^k*n)*x - k) +n-e^-k where n is the gradient value we want to set at armor zero, k is our curvature parameter and x is our armor percentage.

Here is an example curve that scales between .1 and 1. You can play with the numbers to come up with a curve of your choosing. With 80% of armor remaining

Wolfram Alpha basic parameterization

With 80% of armor remaining this will show 57% of the full gradient!. With 60% armor remaining this will show 34% of the full gradient at 40% armor remaining, 21% of the full gradient, at 20% it will show 14% of the full gradient. And at 0% 10% of the full gradient.

If we wanted a purposeful curve that had like... real numbers attached to it then... I am not going to do this work. Because its late and i have spent far to much time trying to parameterize this already[edit: Alec Baldwin as the narrator "He did do that work"]. But we would probably want to tie it such that the gradient matched the percentage of armor kill time left assuming that the maximum armor hit strength was minimum. This isn't perfect but its... kinda reasonable. Obviously if your hit strength is more than minimum at their maximum armor you will have a different curve... a flatter curve. And if your hit strength is less than minimum you will have... a steeper and segmented curve. So a hit strength at exactly minimum damage for the targets maximum armor is probably best.

A HE beam that does perfectly minimum damage to an enemies maximum armor will theoretically perfectly kill armor that has no minimum armor value[which is important to being able to parameterize this] in about 21.8 seconds. It takes about 6.7 seconds to get through the first 20%, 12.3 to get through the second 20%. So on and so forth. If we parameterize to these percentages we get a graph that looks kind of like this.

Wolfram Alpha theoretical close paramaterization


I am sure this is solvable at the limit but i am fundamentally not that great at math anymore. I got kill times via excel. I chose the parameters by hand. Its good enough. I don't think you could tell the difference if you did solve it.

*the logarithm even

edit: something went wrong with my parameterization. hmmm I am not sure why its no longer scaled correctly. it was 3 AM so you know, mistakes happen
Give me a bit.

fixed: It gets slightly more inaccurate as you get lower down the armor scales (its lower than it should be) but this shouldn't be a terrible problem.
« Last Edit: March 14, 2024, 03:28:35 PM by Goumindong »
Logged

Gothars

  • Global Moderator
  • Admiral
  • *****
  • Posts: 4403
  • Eschewing obfuscatory verbosity.
    • View Profile
Re: Armor damage visualization should scale non-linearly
« Reply #11 on: March 14, 2024, 03:36:55 AM »

I find it quite visually pleasing that armor doesn't show damage immediately, makes it more satisfying (or horrifying when you are inside the armor) when it does finally "crack".

What I'd really like see is the shading representing absolute armor strength, so that weakly armored ships start of with a darker shade. It's cumbersome that you have to remember or look up armor values in a separate menu. Of course that would bring readability issues that had to be solved.

Maybe 1) making the absolute value per size class and 2) introducing some visual patterns in addition to the shading would be enough. Then an HA-Enforcer would have a, say, dotted armor grid while a shrike would have a half grayed out one.

Even half the idea would help, with just heavily armored ships getting a visual pattern on their grid.
Logged
The game was completed 8 years ago and we get a free expansion every year.

Arranging holidays in an embrace with the Starsector is priceless.

SafariJohn

  • Admiral
  • *****
  • Posts: 3023
    • View Profile
Re: Armor damage visualization should scale non-linearly
« Reply #12 on: March 14, 2024, 04:35:50 AM »

This ain't a maths question brother, I'm talking about the fact that even after shooting the same spot multiple times you literally can't tell that any damage has been done unless you look very closely for a subtle difference in shading, and then all of a sudden it gets stripped completely by the next 2 shots. Nothing about that fits the description of "clear."

Maybe there should be a highlight of some kind on the most damaged armor cell on a ship? Targeting computer saying "shoot here".
Logged

Goumindong

  • Admiral
  • *****
  • Posts: 1896
    • View Profile
Re: Armor damage visualization should scale non-linearly
« Reply #13 on: March 14, 2024, 01:53:33 PM »

What I'd really like see is the shading representing absolute armor strength, so that weakly armored ships start of with a darker shade.

If you use my parameterization and set the max armor as it’s classes max armor then this also works

Buuut it has problems.

class max armor is highly variable. A shield shunted heavy armor armored weapon mount centurion has 825 armor. A regular centurion has 500. About 60% of that armor. Which means it has about 40% of the armor HP kill time assuming min armor hits at 825 armor…. Which means it starts 40% as bright…

Even if you used a linear gradient on raw armor value you will find huge armor discrepancies. AWM, smod shield shunt, heavy armor XIV has ~3150 armor. Every other capital in the game has half this
(Except the invictus but the invictus more rightly has 1000 armor for DR purposes)

Edit: basically what I am saying is that the gradient I provided is theoretically sound while showing most of the things people want and showing relative armor values isn’t reasonable in almost any framework.

Maybe you could just put a max armor value and “shield efficiency” number on the lock on info and then you know.
« Last Edit: March 14, 2024, 01:55:36 PM by Goumindong »
Logged

Goumindong

  • Admiral
  • *****
  • Posts: 1896
    • View Profile
Re: Armor damage visualization should scale non-linearly
« Reply #14 on: March 14, 2024, 03:29:22 PM »

A note that i had to fix the final paramaterization due to me mistyping things at 3 AM last night.

edit: if that is a pain to calculcate the most simple parameter is 0. So this would be is e^(log(2)*armor%)-1... which is equivalent to 2^x-1...

Which means that a lot of this parameterization could be replaced with

(n^x-1)/(n-1) so long as we want to end at 0. Where n is our fixed parameter.

Which means that 3.7713 is pretty close and it overestimates low armor TTK by a bit which is good due to minimum armor.
« Last Edit: March 14, 2024, 03:57:31 PM by Goumindong »
Logged