Resistance calculations

Recommended Posts

The idea of current armour is that +1 is always +X% (I don't remember what percentage exactly, maybe 10%), whether your base armour is 1 or 999 doesn't matter.

There are three approaches for resistance, broadly:

• Raw numbers (AoE 2) -> has the drawback of being very prone to unexpected big changes from small deltas (e.g. a +1 tech can be anywhere from 0% to -50% damage in practice)
• Percentage points -> Add 10 percentage points of resistance. So if you had 80%, you now have 90%. The problem is likewise that a tech can have very different effects, but you sort of avoid the thresholding problem. AoM used a system like that IIRC.
• An exponential system like 0 A.D. uses, where + 1 armour is always +10% armour, no matter what the base armour level is. This is easy to reason about for techs, and easy to reason about for users. But it means you technically cannot have 100% resistance to some damage, though in practice the difference is limited.
The main drawback is that the math is kind of unintuitive & raw points don't tell the whole picture.

Share on other sites

1 hour ago, real_tabasco_sauce said:

There seems to be diminishing returns with additional armor levels. I kind of like it.

there are not, really. life time of soldiers under constant attack increases exponentially with resistance level.

Share on other sites

1 hour ago, wraitii said:

we need D3886 to make resistance opt-in rather than opt-out

@bb_ has a valid point, and if we talk about modders expectation, undefined == infinity sounds simply backwards. "No resistance (defined) is zero resistance" is true for all natural langues I know. Javascript having them both falsey is telling as well. Adding INF for all to the default/base template is certainly more natural.

8 hours ago, wraitii said:

we need to normalise all resistances to 0 and adjust health accordingly

So we break healing rate and repair rate to prettify some numbers? I suspect people like @chrstgtr are only bothered with those numbers because they have to look at them regularly for checking the opponents upgrades. If they weren't reflected or only accessible via other means, like entity model changes or let's say changes to the spy interface they couldn't be bothered. If you want to go ahead with this please also state how you intend to handle healing/repair.

On 06/05/2022 at 10:33 AM, maroder said:

Then it's more of a philosophical question if player should understand exactly what happens or if its enough to understand that more == better

Well, I admit that some people want to know how it exactly works and there is no reason to prevent them to figure it out. I also checked the code when I started playing. The point is beside satisfying our curiosity it's mostly useless information. If you know the formula you need maybe 10 games and without maybe 50 games to figure out the impact. After that the value of this info is pretty much exhausted.

Anyway, the table posted by Nescio in the linked thread is much better for this purpose than the gui could ever be. So if you don't want people to have to check the code, a wiki page seems the right choice.

Share on other sites

44 minutes ago, hyperion said:
10 hours ago, wraitii said:

we need to normalise all resistances to 0 and adjust health accordingly

So we break healing rate and repair rate to prettify some numbers? I suspect people like @chrstgtr are only bothered with those numbers because they have to look at them regularly for checking the opponents upgrades. If they weren't reflected or only accessible via other means, like entity model changes or let's say changes to the spy interface they couldn't be bothered. If you want to go ahead with this please also state how you intend to handle healing/repair

It’s just not intuitive, which makes the game inaccessible to new players. It doesn’t impact me much. New players will ask me questions all the time that are like “what wins—one spear or one jav?” That shouldn’t be a difficult question and we shouldn’t need to play the game for hours to have an intuitive feel.

Even though I know how units perform against one another, I can’t guess what units stats are and that’s probably a problem.

its not probably not a problem for anyone commenting here, but I think it would be good for new players.

Edited by chrstgtr
Share on other sites

2 hours ago, wraitii said:

+X%

should be multiplied not added right?

Share on other sites

1 hour ago, alre said:

there are not, really. life time of soldiers under constant attack increases exponentially with resistance level.

yes IK, i play the game too. It's just mathematically less. What this does mean is that upgrading pierce armor for units with 1 pierce armor is more impactful than if they already have 10. Thats what i mean.

Share on other sites

3 minutes ago, real_tabasco_sauce said:

yes IK, i play the game too. It's just mathematically less. What this does mean is that upgrading pierce armor for units with 1 pierce armor is more impactful than if they already have 10. Thats what i mean.

and it's wrong. mathematically more and less depend on the metric space you are using, and using the familiar euclidean metric on percentages is pretty naive.

An upgrade that raises by 1 the pierce armor of some unit is like canceling one arrow in 10 that hits that unit (maybe not exacly 10 idk), regardless of its original armor value. its health is just as relevant.

Share on other sites

2 hours ago, alre said:

and it's wrong. mathematically more and less depend on the metric space you are using, and using the familiar euclidean metric on percentages is pretty naive.

An upgrade that raises by 1 the pierce armor of some unit is like canceling one arrow in 10 that hits that unit (maybe not exacly 10 idk), regardless of its original armor value. its health is just as relevant.

is what I graphed wrong? I just was saying I like that it is nonlinear.

Edited by real_tabasco_sauce
Share on other sites

8 hours ago, wraitii said:

Percentage points -> Add 10 percentage points of resistance. So if you had 80%, you now have 90%. The problem is likewise that a tech can have very different effects, but you sort of avoid the thresholding problem. AoM used a system like that IIRC

I'm going to visually reinforce Wraitii's post.

8 hours ago, wraitii said:

Raw numbers (AoE 2) -> has the drawback of being very prone to unexpected big changes from small deltas (e.g. a +1 tech can be anywhere from 0% to -50% damage in practice)

I always liked this one better as a non-mathematical player.

Share on other sites

7 hours ago, hyperion said:

So we break healing rate and repair rate to prettify some numbers?

I also don't agree with "normalizing" health/armor points in the proposed way.

Share on other sites

18 minutes ago, Lion.Kanzen said:

Notice that the stats shown here are very few. Basically only the most pertinent information for quick combat spit balling.

Share on other sites

17 hours ago, wraitii said:

Also, it's called resistance because you can't have armour against status effects or capture, technically.

Okay?

Share on other sites

51 minutes ago, wowgetoffyourcellphone said:

Notice that the stats shown here are very few. Basically only the most pertinent information for quick combat spit balling.

Indeed.

we should have a calculator.

Share on other sites

12 hours ago, hyperion said:

@bb_ has a valid point, and if we talk about modders expectation, undefined == infinity sounds simply backwards. Adding INF for all to the default/base template is certainly more natural.

I completely disagree. What if a modder doesn't use the base template? What if we had hundreds of damage types against specific units, like Aoe2 does? That's just asking for a mess.
Not to mention the possibility of technologies suddenly making units that were impervious to some damage actually take that damage.

12 hours ago, hyperion said:

Javascript having them both falsey is telling as well.

Except a resistance of 0 is 100% of damage taken, because the formula is exp(0), whereas exp(undefined) is Nan. So it's not like they're actually the same at all in Javascript.

Maybe Resistance needs to be renamed again, but I've yet to see a convincing counter-argument to that diff.

12 hours ago, hyperion said:

So we break healing rate and repair rate to prettify some numbers? If you want to go ahead with this please also state how you intend to handle healing/repair.

Right, let me add a bullet point:

• Healing rate is expressed as a % of health instead of a fixed HP rate

(note that's also fairly arbitrary though. One can argue that more HP means you should be healed slower as a debuff. I just point out it's a trivial fix).

---

Of course, there is an alternative option here. Have all units have the same HP, and change their armour. It comes out exactly the same, of course.

Share on other sites

19 hours ago, wraitii said:

Healing rate is expressed as a % of health instead of a fixed HP rate

Not for healing in structures, idle healing and healing by healers?

Share on other sites

On 08/05/2022 at 7:42 PM, wraitii said:

There are three approaches for resistance, broadly:

• Raw numbers (AoE 2) -> has the drawback of being very prone to unexpected big changes from small deltas (e.g. a +1 tech can be anywhere from 0% to -50% damage in practice)
• Percentage points -> Add 10 percentage points of resistance. So if you had 80%, you now have 90%. The problem is likewise that a tech can have very different effects, but you sort of avoid the thresholding problem. AoM used a system like that IIRC.
• An exponential system like 0 A.D. uses, where + 1 armour is always +10% armour, no matter what the base armour level is. This is easy to reason about for techs, and easy to reason about for users. But it means you technically cannot have 100% resistance to some damage, though in practice the difference is limited.
The main drawback is that the math is kind of unintuitive & raw points don't tell the whole picture.

Any of these suggestions has math that might be intuitive in some situations.

Any sentence used to describe the system does not provide a good intuitive way to judge statistics. When it is impossible to explain the entire story in one sentence, the best might be to use a few extra ones.

What I would suggest is that if you look is to give more information in the structure tree when selecting the armor upgrades. Example:

Edited by LetswaveaBook
Changed image.
Share on other sites

53 minutes ago, LetswaveaBook said:

maybe: upon gaining +1 pierce armor, units receive 10 percent less pierce damage?

Share on other sites

3 hours ago, LetswaveaBook said:

Any of these suggestions has math that might be intuitive in some situations.

Any sentence used to describe the system does not provide a good intuitive way to judge statistics. When it is impossible to explain the entire story in one sentence, the best might be to use a few extra ones.

What I would suggest is that if you look is to give more information in the structure tree when selecting the armor upgrades. Example:

There are many technologies that need to clear that.

Share on other sites

On 09/05/2022 at 10:21 AM, wraitii said:

I completely disagree. What if a modder doesn't use the base template? What if we had hundreds of damage types against specific units, like Aoe2 does? That's just asking for a mess.
Not to mention the possibility of technologies suddenly making units that were impervious to some damage actually take that damage.

Well, if one doesn't want to inherit the values for whatever unfathomable reason one specifies them oneself ... This is sort of to obvious so I think I miss your point. As for switching from invulnerable to vulnerable and back you'd need basically the same code independent of how it's encoded.

About the default per se, invulnerable or no resistance doesn't matter much in my opinion and might depend on the mod as well. What I object is that this is cleaner easier more intuitive for modders. I see how it makes perfect sense if you are familiar with the implementation tho.

In my eyes the best would be to make it required, have a file list all damage types supported in this mod and populate the base template with sane defaults (might also be 20 for high resistance). If a modder wants 0 he writes 0, if he wants INF he writes INF. If he misses one, the parser will spit out no resistance defined for damage type. If there is a typo, the parser spits out no such damage type configured. So no ambiguity, full flexibility plus a safety net.

On 09/05/2022 at 10:21 AM, wraitii said:

Healing rate is expressed as a % of health instead of a fixed HP rate

No longer broken but surely disruptive. Might or might not be a blessing tho. One thing to consider here is that adding extra rules might just offset any gain from "simplifying" resistance values.

Share on other sites

Resistance is futile

• 1
• 3
Share on other sites

7 minutes ago, borg- said:

Resistance is futile

We are the Borg, lower your shields and surrender. You will be assimilated. Your biological and technological distinctiveness will be added to our own. Your culture will adapt to serve us. Resistance is futile.

Fire damage has no armour to counter so we need fire armour.

Share on other sites

53 minutes ago, Sevda said:

Fire damage has no armour to counter so we need fire armour.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.